Designed a class that demonstrates the use of constructor and destructor.



class xyz
{
xyz()
{
System.out.println("Constructor method........");
}
protected void finalize()
{
System.out.print("Garbage Collected.....");
}
}
class prac4B
{
public static void main(String args[])
{
xyz ob=new xyz();
ob=null;
System.gc();
}
}