Question about Sun Computers & Internet

1 Answer

J2SE Java is not pure (100%) object oriented langauge Why?

Posted by on

1 Answer

  • Level 1:

    An expert who has achieved level 1.

    Problem Solver:

    An expert who has answered 5 questions.

  • Contributor
  • 6 Answers

Many languages claim to be Object-Oriented. While the
exact definition of the term is highly variable
depending upon who you ask, there are several
qualities that most will agree an Object-Oriented
language should have:

1. Encapsulation/Information Hiding
2. Inheritance
3. Polymorphism/Dynamic Binding
4. All pre-defined types are Objects
5. All operations performed by sending messages to
Objects
6. All user-defined types are Objects
Fair enough...

Java IS by virtue of 1, 2, 3, and 6.
Java IS NOT by virtue of 4 and 5 (not all pre-defined types are Objects, and not all operations are performed by sending messages to Objects).

But since the definition says only that an OOPL should have these things, then Java qualifies.

Next up; given that definition, how would one define "100%"? Exhibiting all those qualities? If that's the case, Java fails the "purity test".

Posted on Sep 21, 2008

1 Suggested Answer

6ya6ya
  • 2 Answers

SOURCE: I have freestanding Series 8 dishwasher. Lately during the filling cycle water hammer is occurring. How can this be resolved

Hi,
a 6ya expert can help you resolve that issue over the phone in a minute or two.
best thing about this new service is that you are never placed on hold and get to talk to real repairmen in the US.
the service is completely free and covers almost anything you can think of (from cars to computers, handyman, and even drones).
click here to download the app (for users in the US for now) and get all the help you need.
goodluck!

Posted on Jan 02, 2017

Add Your Answer

Uploading: 0%

my-video-file.mp4

Complete. Click "Add" to insert your video. Add

×

Loading...
Loading...

Related Questions:

1 Answer

What is difference between a class and an object with respect to Java?


This kind of question is a test of your knowledge of the terminology associated with object oriented programming. You should note that this question could just as well be asked in the context of a C++ programmer interview, or any programming position that requires object oriented programming for that matter.
The terms 'class' and 'object' are definitely related to one another, but each term holds its own distinct meaning. Let's start out by explaining what the term "class" means in the context of OOP. The term 'class' refers to the actual written piece of code which is used to define the behavior of any given class. So, a class is a static piece of code that consists of attributes which don't change during the execution of a program - like the method definitions within a class.
An object is an instance of a class The term 'object', however, refers to an actual instance of a class. Every object must belong to a class. Objects are created and eventually destroyed - so they only live in the program for a limited time. While objects are 'living' their properties may also be changed signficantly.
An example will help clarify what we've said. Suppose we have a class called 'Animal'. All Animals have bodies and brains - and these could be the attributes of our fictional Animal class. We can also add some methods that would be common to all Animals - like "movement", because all animals can move (maybe you can think of a better example for methods, but hopefully you get the point). So, the idea you really want to enforce in your own mind is that this very general 'template' of an Animal does not change - it's simply just some lines of code that define the Animal class.
An instance of the Animal class would be a specific animal - like a lion, a cat, or a zebra. These instances of the Animal class would be called objects. Whereas the Animal class is a general concept, the instances of that class - the lions, cats, etc - take that general concept and create a real instance of it. That is why programmers define constructors for their classes - so that when someone wants to create an object of the class, he/she can just pass in the actual properties that he/she wants the object to have - like what kind of animal it is, the name, the weight, etc. So, you can think of a constructor as something that brings the class to life - which is why it is called a constructor, because it constructs a specific instance of a class.
Objects have a lifespan but classes do not And, as our Animal example clearly shows, every object has a lifespan associated with it - a cat or zebra can not live forever. And, the properties of those objects can change as well while they 'live'; if we have a 'size' variable defined in the class that would of course change as the cat object grows bigger.
Object versus class summary So, we can say that whereas a class is a general concept (like an Animal), an object is a very specific embodiment of that class, with a limited lifespan (like a lion, cat, or a zebra). Another way of thinking about the difference between a class and an object is that a class provides a template for something more specific that the programmer has to define, which he/she will do when creating an object of that class.
Objects have a lifespan but classes do not And, as our Animal example clearly shows, every object has a lifespan associated with it - a cat or zebra can not live forever. And, the properties of those objects can change as well while they 'live'; if we have a 'size' variable defined in the class that would of course change as the cat object grows bigger.
Object versus class summary So, we can say that whereas a class is a general concept (like an Animal), an object is a very specific embodiment of that class, with a limited lifespan (like a lion, cat, or a zebra). Another way of thinking about the difference between a class and an object is that a class provides a template for something more specific that the programmer has to define, which he/she will do when creating an object of that class.

Jul 16, 2014 | Computers & Internet

2 Answers

What is strings in java?


Handling character strings in Java is supported through two final
classes: Java String and StringBuffer. The String class implements immutable character strings, which are read-only once the string has been created and initialized, whereas the StringBuffer class implements dynamic character strings. All string literals in Java programs, are implemented as instances of String class. Strings in Java are 16-bit Unicode.

Nov 21, 2012 | Sun Java Programming Language (cdj-275)

4 Answers

What is java script


Java script is a program that works with other programs such as Adobe Flash Player and many others to procees and enable you to read and store items. You can get Java here;
http://www.java.com/en/
If you were trying to watch YouTube you would have to have Java and a Flash Player in order for your system to process and play the video. I f you need Flash Player you can get that here;
http://get.adobe.com/flashplayer/
You have to make sure you have no prior versions of either of these products so, check in device manager and make sure you don't have prior versions. If you do, unistall the prior versions before download od new versions.

May 10, 2011 | Sun Computers & Internet

1 Answer

I need to write a java code for a one player snakes and ladders game


http://www.scribd.com/doc/31905900/Java-Programming-Creating-a-Snake-and-Ladders-Game-and-Object-oriented-concepts
if you go to the website it will teach you how to do it

Feb 27, 2011 | Sun Java Programming Language (cdj-275)

1 Answer

What is singleton model


The Java Singleton pattern belongs to the family of design patterns that governs the instantiation process. A Singleton is an object that cannot be instantiated. This design pattern suggests that at any time there can only be one instance of a Singleton (object) created by the JVM. You implement the pattern by creating a class with a method that creates a new instance of the class if one does not exist. If an instance of the class exists, it simply returns a reference to that object

Jul 20, 2010 | Sun Java Programming Language (cdj-275)

1 Answer

Hey plz help me java better ya .net ya oracle??


10 Reasons Why dotNET Is Better Than Java

This post is prompted by a post by SANDIP when he said something like "Java Is Dead" and some people were like attacking him for expressing his view.

I've been a fan of the Java technology for quite some time now. I remember literally copying a Java book when I didn't have the money to buy it.

But one thing I discovered with technology is that it's not always about love but it's more about power.
The bitter truth is when I compare java technology with CLI (popularly known as .NET), I see that Java is less powerfull in many areas.

I'll be using the words CLI and .NET interchangeably refferring to any implementation of the CLI (.NET, Mono or dotGnu)
This are some of my points.

1- In .NET you have a choice of languages to code with (C#,VB.NET, Java,Boo,Python e.t.c), producing the same type of compiled code but in Java one is limited to the java language. One may argue that jython is an alternative, but even the creator of jython who later created it's .NET version called IronPython admitted that .NET is a more powerful technology.

2, NET prgrams run at native speed while java is interpreted which makes java slower.Although java has Just In Time compilation but it stills run slower. With .NET you are not limited to JIT but have the option AOT or ahead of time compilation if you want to eliminate startup delays.

3. Calling native code in java is not a very clean process. You need to generate some stub files which makes the whole process cumbersome and dirty. In .NET you just declare that you are calling a native function from a specified library and just start calling it.

4. .NET languages are richer than Java. They have object oriented feature that are absent in java e.g properties,delegates,generics.

5. Java GUI programs look alien on the host operating system. Even if you use the OS's theme you still notice that the java widgets look out of place.

6. .NET in the form of Mono has brought a whole revolution on the linux desktop in form of great applications like beagle, tomboy, diva, iFolder, banshee e.t.c. This is something that java has failed to do despite the fact that it's been there long
before .NET

7. Many programs that would have been difficult to develop with java have been developed with .NET things like compilers (Mono's C# and VB.NET) 3D game engines (unity game engine) e.t.c

8. The CLI is an open standard maintained by an independent standards organization (E.C.M.A) while java is still governed by SUN microsystems.Even though java has recently been open-sourced, it's future will still be highly influenced by SUN.

9. You can code on the .NET platform using Java but you cannot code on Java platform using any of the .NET languages.

10. Using Mono's IKVM to call java code from .NET or convert java classes to .NET assemblies. This is so efficient that large java programs like the eclipse I.D.E have been runned on .NET.

This is not an exhaustive list but I believe 10 points are enough to send the message.

One more thing, feel free to criticize my views or even flame me.

----YOUR CHIRAG------

Jul 17, 2010 | Sun Java Programming Language (cdj-275)

1 Answer

Why main function is made static in java


Hi,
Its very easy dear. In java everything is object oriented. You will call a function through an object. Now we are calling the main method without any object as we do not create any object of the class that contains a main method. So call the main method we need to declare main as static methos so its not a part of an object but a class so that mian method can be called without having creating any object of the class.
Regards, polysandy

Jun 27, 2010 | Sun Java Programming Language (cdj-275)

2 Answers

What is the basic difference between c and c


There are many differences between C and C++. Basically we have 5 OOPs concept which is followed by C++ a)Inheritance b)Polymorphism c)Encapsulation d)Abstraction e)Object C is a procedural language which does follow polymorphism and inheritance concept. Major one are as follow 1)C is data oriented and C++ is object oriented language.This implies C is inefficient in handling real world problem as there is no class concept present. 2)C uses top down approach and C++ uses bottom up approach. 3)There is no concept of inheritance in C. 4)C++ have concept of dynamic memory dispatch,which is not supported by C 5)C is function oriented while C++ i,Function are building blocks of C while objects are building block of C++ program 6)C++ have function overloading but C dont have. 7)C++ also have concept of namespace. 8)C++ have reference variables but C dont have it. 9) Standard input,output function aree different in both languages. 10)C++ is free form language means we can declare variable at any place but in C we can declare only at starting of main block.

Jun 18, 2010 | Computers & Internet

1 Answer

Need sloution for ---


plz change replce the name of Data provider object ODBC with OLEDB.
i hope the exception will be vanished.

Oct 07, 2008 | Computers & Internet

Not finding what you are looking for?
Computers & Internet Logo

Related Topics:

229 people viewed this question

Ask a Question

Usually answered in minutes!

Top Sun Computers & Internet Experts

Les Dickinson
Les Dickinson

Level 3 Expert

18333 Answers

Brian Sullivan
Brian Sullivan

Level 3 Expert

27725 Answers

Cosma Papouis
Cosma Papouis

Level 3 Expert

404 Answers

Are you a Sun Computer and Internet Expert? Answer questions, earn points and help others

Answer questions

Manuals & User Guides

Loading...