Skip to content

Instantly share code, notes, and snippets.

@bertanasco
Created September 9, 2011 13:12
public class C extends A{
//instance method, this is overriding
public void print(String x ){
System.out.println(x + " [baby] " ) ;
}
public static void main (String [] args) {
C c = new C () ;
c.print ("test overriding");
}
}
class A {
//instance method
public void print(String x ){
System.out.println(x + " [mama] " ) ;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment