Created
January 29, 2018 11:59
-
-
Save sumon-sarker/76ce664ba75d7480d789f42892b42e99 to your computer and use it in GitHub Desktop.
How JAVA constructor works
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*File : Html.java*/ | |
import packages.*; | |
public class Html extends Php{ | |
public Html(){ | |
super(); /*Parent Constructor Initialization*/ | |
} | |
public static void main(String args[]){ | |
System.out.println("Welcome to HTML 5"); | |
Html html= new Html(); /*Self Constructor Initialization*/ | |
} | |
} | |
/*======================File : packages/Php.java======================*/ | |
package packages; | |
public class Php extends MySql { | |
public Php(){ | |
System.out.println("PHP has been initialized"); | |
} | |
} | |
/*======================File : packages/MySql.java======================*/ | |
package packages; | |
public class MySql { | |
public MySql(){ | |
System.out.println("MySql has been initialized"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment