What is an object in Java and what are its benefits?
Answer Posted / sumit pal singh
An object in java is a runtime entity of a java class. It has two characteristics 1. State (variables) and 2. Behavior (methods). It has below benefits
1. By creating the object of one class into another class we can get the state and behaviour of another class . i.e. Composition is best example for using the object.
| Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
How do you declare an array in java?
What are the methods of object class ?
How do you override a private method in java?
How does thread synchronization occurs inside a monitor? What levels of synchronization can you apply?
What is the purpose of extern variable?
What is meant by 'bit masking' in java?
What happens if I remove static from main method?
Difference between Linked list and Queue?
What is a numeric digit?
What is the advantage of preparedstatement over statement?
How to invoke external process in java.
How do you join strings in java?
When is an object subject to garbage collection?
What is math exp in java?
What is anagram number?