Java默认构造函数


Java默认构造函数

public class Tester {



   private String message;



   public Tester(){

      message = "Hello World!";

   }



   public String getMessage(){

      return message ;

   }



   public void setMessage(String message){

      this.message = message;

   }



   public static void main(String[] args) {

      Tester tester = new Tester();

      System.out.println(tester.getMessage());   

   }

}