What is an Object and how do you allocate memory to it?

What is an Object and how do you allocate memory to it?

An object is a runtime entity. It is an instance of the class and have its own state, made up of values assigned to all variables of its class collectively. An object will hava access to all the behaviours(methods) of its class.

The object can be allocated memory using the \"new\" keyword. For Example : 
//class declaration
class CrateObject{
}
//Object creation
CreateObject o = new CreateObject();

By:Jalees
Date:2016-01-09 00:00:00

Post Your Answers


User Email:

User Name:
Answers:

Related Java Subjective Links

Java Subjective interview questions and answers for experienced and fresher