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


Please Help Members By Posting Answers For Below Questions

What is a blocking method in Java?

578


When a byte datatype is used?

544


What is a parameter in a function?

507


What is a singleton class? Give a practical example of its usage.

562


What does a method signature consist of?

487






What about static nested classes in java?

567


What will be the initial value of an object reference which is defined as an instance variable?

612


What is array initialization in java?

471


How many bits is a string?

501


What are wrapped classes in java programming?

561


What are the methods of object class ?

539


what is recursion in java

573


Is ++ operator thread-safe in java?

603


What is data type in computer?

498


Explain what do you mean by functional overloading in java?

535