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

How to create a fecelet view?

565


Why collection doesn’t extend cloneable and serializable interfaces?

649


What restrictions are placed on method overriding?

644


What is the main use of java?

576


What is an accessor?

1053






How to call one constructor from the other constructor ?

609


What is meant by stack and queue?

608


Which data type is a class in java?

573


What is java object name?

551


How to access arraylist elements in java?

495


Why is multiple inheritance not supported in java?

564


What are the application of stack?

506


Can we have 2 main methods in java class?

543


why java uses class level type casting ?

2255


What is the maximum size of hashmap in java?

540