Simple Java Program using constructors.
Here the constructor is “Cars”.
//constructors
public class Cars
{
public Cars(String name)
{
System.out.println("super "+name);
}
public static void main(String []args)
{
Cars bmw=new Cars("cars");
}
Comments
Post a Comment