Priya
Answered On : Mar 15th, 2012
We can construct the objects for a class by using the new keyword in java.
Suppose take an Employee class and we can construct the objects for this class in the following way.
Employee emp=new Employee();
Constructing the objects means we are allocating the memory for the object which can be used to access the
instance variables and instance methods of the class.with out allocating the memory we cannot access them.
Login to rate this answer.
Priya
Answered On : Mar 16th, 2012
In java Object destruction is automatically done by Garbage Collector which is provided y java run time system.
when ever the scope of the object is over then the memory which is allocated for that object is released by the garbage collector.The programmer no need to do anything explicitly.
Login to rate this answer.