Skip to content

Instantly share code, notes, and snippets.

@ajduke

ajduke/SuperOP3.java

Created Aug 20, 2012
Embed
What would you like to do?
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