class ClassOne { public say() { System.out.println("Here goes:"); } }
class ClassTwo extends ClassOne { public say() { super.say(); System.out.println("Hello"); } }
Now, new ClassTwo().say()
will output:Here goes:
Hello
more detail
http://docs.oracle.com/javase/tutorial/java/concepts/inheritance.html
No comments:
Post a Comment