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 java reflection api?

562


What are use cases?

563


What is a java list?

590


What is singleton class in java and how can we make a class singleton?

580


Does java have extension methods?

537






what is the use of pojo (plain old java objects)? how it is interact with crystal reports? pls urgent

1737


What is the difference between jdk, jre, and jvm?

578


What is size of int in java?

559


What happens when heap memory is full?

535


Can constructor return value?

514


Is a method a function?

559


What does I ++ mean?

613


What is abstract class constructor called?

575


what is inner class in java?

628


Which method returns the length of a string?

575