Tuesday, February 24, 2009

simple constructor example



package cons;

public class Student {
Student()
{
System.out.println("Student");
}
public static void main(String ar[])
{
Student c=new Student(); //Student
// when the object creates constructor will execute automaticaly
}
}


0 comments:

Post a Comment