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
Is set thread safe java?
Discuss 2D arrays.
These static constructors are correct ? class A { statc intA() { } static A(int x,int y) { } static A(int x) { } }
Which class represents the socket that both the client and server use to communicate with each other?
How infinite loop is declared?
What is qualitative variable?
What is a numeric format?
Are maps ordered java?
Explain methods specific to list interface?
What are the differences between c++ and java?
What is preparedstatement in java?
What is the access scope of protected access specifier?
What is defined as false sharing in the context of multithreading?
Which collection is best for sorting in java?
Why we override equals() method?