Last active
February 23, 2017 06:49
-
-
Save YugandharVadlamudi/c0b5e537167a7635e0863720ead9f85d to your computer and use it in GitHub Desktop.
This file contains hidden or 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
class DemoConstructorOverload | |
{ | |
/** | |
*Constructor means method name is same as classname and no return type | |
*DemoConstructorOverload() is constructo | |
*/ | |
DemoConstructoroverload() | |
{ | |
System.out.println("hello default constructor"); | |
} | |
DemoConstructoroverload(String s) | |
{ | |
System.out.println("hello default constructor 1::"+s); | |
} | |
public static void main(String[] a1) | |
{ | |
DemoConstructoroverload d=new DemoConstructoroverload(); | |
DemoConstructoroverload d1=new DemoConstructoroverload("yugandhar"); | |
} | |
####output#### | |
D:\softwares\java_programs>java DemoConstructoroverload | |
hello default constructor | |
hello default constructor 1::yugandhar |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment