it is told that in object oriented language every thing is an object..
ihave written two lines:-

int a;
Object b;

when i do b. options appears but when i do a. options do not appear..accourding to theory a is also an object then why the same option appear for a as of b??

Recommended Answers

All 2 Replies

In as PURE OO langage like SmallTalk that's true, but not for Java.
The designers of Java were worried about the overheads of using an Object for simple stuff like numbers or true/false, so they decided to have some data types, called primitives, that are not objects, and have none of the overheads of objects.
The primitive types are:
byte short int long char float double boolean
(notice they all have names beginning with a lower case letter). Everything else in Java IS an object.

also: "option appears" ...
this kind of tells me you are using an IDE.
when just learning a language (which is obviously the case) you should not use an IDE. yes, it comes in handy, but if you start this way, you don't learn how to write code, compile, package and run it, all you really learn is to use (and heavily rely on) your IDE.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.