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

Write a program to print fibonacci series up to count 10.

964


What do you understand by classes in java?

1046


What is hotjava?

1067


When super keyword is used?

1057


What does sprintf return?

1116


What are the string methods in java?

1132


How java is similar to c?

1089


What is bubble sorting in java?

1110


What is multi level inheritance in java?

1079


Which methods are used during serialization and deserialization process?

1040


How does a cookie work in Servlets?

898


Which software is used for java programming?

1081


What is assembly language?

1059


What is the difference between variable declaration and variable initialization?

1094


What is a singleton puppy?

1040