Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

what is an object and how do you allocate memory to it?

Answer Posted / tulasi

Object is an instance of the class.There are two ways by
which a new object is created.

1.using new operator.
example:
classname objectname=new classname;
This allocates the memory to objectname.

This can be classname objectname by which null values are
set to the objectname and not the values as in the class.

2.without using new operator.
Declare the variables as static and also methods used as
static and by using the keyword static we can create an
instance of the class.
Thus, we use public static void main(String args[])in main
program where theres no need to create a class and also
instance of class using new operator.

Is This Answer Correct ?    8 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is contractor means and methods?

997


What is the diffrence between inner class and nested class?

1090


Why string is immutable with example?

979


In the below example, what will be the output?

1029


What is the relationship between clipping and repainting under awt?

1149


What is join () in java?

964


What is procedure overloading?

2313


Where import statement is used in a java program?

1130


What is the current version of java?

1038


Is it possible to specify multiple jndi names when deploying an ejb?

996


What is package private scope in java?

948


What is method overloading in java ?

1088


What is the purpose of finalization in java programming?

1028


What is a line break example?

1000


What is struts in java?

1039