what is the difference between object and class
Answer Posted / prema
Class is a template or a plan for creating objects.
For example: For construction of building we need a plan.
Without plan we can't construct building. Here plan acts as
class. Building acts as object.Using the same plan we can
build any number of building.
In the same way we can create any number of objects for the
same class.Class tell whats the object state and behaviour.
Basically class tells what the object should have.
Object is an real world entity, which has something and
which know something. It means ojects has state and
behaviour.State of the object is represented by instance
variable. Behaviours are representd by methods.
| Is This Answer Correct ? | 24 Yes | 2 No |
Post New Answer View All Answers
Can we override constructor?
Can you declare the main method as final?
Can we use catch statement for checked exceptions when there is no chance of raising exception in our code?
What are the three parts of a lambda expression?
Is overriding possible in java?
What is a condition in java?
What is application tier?
What is the difference between yield() and sleep()?
What is anagram of a string?
explain copyonwritearraylist and when do we use copyonwritearraylist?
What is the function of compareto in java?
What are 5 boolean operators?
State the difference between creating string as new () and literal.
Is linkedlist thread safe in java?
What is the use of bufferedreader?