What is an object in Java and what are its benefits?

Answer Posted / javamasque

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. Encapsulation (Data hiding): It hides data and internal implementation from other objects.
2. Modularity (task modulation): It contains a set of activities for a specific task of an application.
3. Reusability: It facilitates reusability of functionality through inheritance.
4. Easy maintenance: It enhance the readability and understandability of an application. It also helps the developer to trace bugs in an application.
5. Pluggable/Unpluggable: An erroneous/unwanted object can be removed and a new object can be added in an application.

Is This Answer Correct ?    1 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can we increase size of array?

555


What is the integer of 16?

527


What is a dynamic array in java?

546


What is encapsulation in java?

609


What are the various access specifiers for java classes?

535






os is developed in c no java is more secured then c na why dont the os developed is developed using java

3505


What does opcode mean?

516


In a container there are 5 components. I want to display all the component names, how will you do that?

1540


How many ways can you break a singleton class in java?

475


What modifiers may be used with an inner class that is a member of an outer class in java programming?

519


What is a prefix function.write down a code to compute prefix function.

522


Which methods cannot be overridden in java?

521


Explain the importance of throws keyword in java?

555


What is the purpose of encapsulation?

529


What is a lock or purpose of locks in java?

575