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 the basic concept of java?

974


What is super constructor?

956


What is a package in java? List down various advantages of packages.

1207


What do you understand by final value?

1007


What is the use of optional ?

991


What is queue in java?

1083


What is the difference between a method and a procedure?

1007


is there a separate stack for each thread in java? : Java thread

936


How many bits is size_t?

945


What are the differences between Java 1.0 and Java 2.0?

2210


What are instance variables?

1039


Can you declare the main method as final?

966


Can we have more than one package statement in source file ?

976


I want to control database connections in my program and want that only one thread should be able to make database connection at a time. How can I implement this logic?

1051


Why arraylist is not synchronized in java example?

983