Created
September 9, 2011 13:12
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
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