Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

different constructiors in java and what they do explained

public class Hello {
   String name;
   //Constructor
   Hello(){
      this.name = "BeginnersBook.com";
   }
   public static void main(String[] args) {
      Hello obj = new Hello();
      System.out.println(obj.name);
   }
}
Source by beginnersbook.com #
 
PREVIOUS NEXT
Tagged: #constructiors #java #explained
ADD COMMENT
Topic
Name
1+7 =