Skip to content

Instantly share code, notes, and snippets.

@ajduke
Created August 20, 2012 12:43
Show Gist options
  • Save ajduke/3403742 to your computer and use it in GitHub Desktop.
Save ajduke/3403742 to your computer and use it in GitHub Desktop.
public class SuperClass {
public SuperClass() {
System.out.println("SuperClass Constr with no params");
}
public SuperClass(int a, int b) {
System.out.println("SuperClass Constr with two params");
}
}
public class SubClasss extends SuperClass {
public SubClasss() {
super(5, 4);
System.out.println("SubClasss Constr with no params");
}
public SubClasss(int a) {
System.out.println("SubClasss Constr with one params");
}
public static void main(String[] args) {
new SubClasss();
System.out.println();
new SubClasss(5);
}
}
Result of execution
SuperClass Constr with two params
SubClasss Constr with no params
SuperClass Constr with no params
SubClasss Constr with one params
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment