Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

What is the difference(or similarity if there are some)
between object and a variable?

Answer Posted / ved.b.tripahti

Variables : variables are the place holder for a particular
type of data and this type actually determine how much space
this var will take in the memory.

int varEx = 2; // here varEx is a integer type variable that
take integer literals and will be used as identifier for the
user.

Object : Object shows the behavior that a particular class
can perform.this object is a medium to access the behaviour
of class.
Object may regards as the blue print of a particular class.

Car carObj = new Car(); // carObj is the reference ID of the
Car class.

here -- new Car() is the actual object that will be created
by JVM.

Note :- Object always created using - new keyword.the
identifier before =, is the reference id of new Car() object,
carObj is not the actual object itself.

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is space character in java?

1116


What is lifetime variable?

968


What modifiers may be used with a top-level class?

1068


What is java life cycle?

1012


Can sleep() method causes another thread to sleep?

1045


What is an array in java?

1208


Can a constructor have different name than a class name in java?

1201


What are the differences between heap and stack memory in java?

1066


Why hashset is used in java?

1082


Why is multithreading important?

952


Is void a type?

990


What is a qms manual?

1001


Which sort is best in java?

979


what happens when a thread cannot acquire a lock on an object? : Java thread

1054


Can an object subclass another object?

1125