Write a default Constructor ?

You can also call a constructor without parameters as default constructor because all of its class instance variables are set to default values.


								
package com.mindclues.constructors;
/**
 *
 * @author Mindclues
 */

 
public class DefaultConstructor {
     
    public DefaultConstructor(){
        System.out.println("It is default constructor...");
    }
     
    public static void main(String a[]){
        DefaultConstructor dcon = new DefaultConstructor();
    }
} 

							

								
It is default constructor...
							

Related Articles

post a comment