Instantiating an object or creating an Object

0

Once we know that a class exist we can use new() keyword for creating object of it. we must create the main program that will instantiate the object. We will call the main program class TestClass. It should look just like how every other java program starts off.  
public class TestClass
{
public static void main(String[] args)
{
}
}
Now we will instantiate the object. To do this we declare a reference to the object called stu and set it equal to a newly created object in memory.
public class TestClass
{
public static void main(String[] args)
{
Student stu = new Student();
}
}

Comments