Hi
we want to know about relationship between class and object? Explain with an example?
Can you explain the relation between class and object? Explain with an example
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.


Satyapriya NayakRank #47 · 31.5K reputationPosted May 23, 2012, 6:09 PM EDT
A class is basically a definition, and contains the object's code. An object is an instance of a class. For instance, there is one java.lang.String class, but you can instantiate any number of distinct java.lang.String objects (instances). While a class defines the instance variables than an object has, the instantiated object itself actually contains those variables. So to put it simply: An object is an instance of a class.
Please refer the below link
http://www.artima.com/objectsandjava/webuscript/ClassesObjects1.html
Thanks