A constructor is a class default method that gets automatically executed whenever class’s object is created or whenever class is initialized.
Consider this example
public class demo
{
public demo ()
{
//A default Constructor
}
//Class members
}
Consider this example
public class demo
{
public demo ()
{
//A default Constructor
}
//Class members
}
No comments:
Post a Comment