InheritanceExample1 1

InheritanceExample1 1 - CSE143 Inheritance Assuming that...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: CSE143 Inheritance Assuming that the forrowing classes have been Example defined: public class One { public void methodl ( ) system. out . println ) ) { ( "onel_" ) ; public class Two extends One { public void method3 O { System. out . println ( "Two3" ) ; ) public class Three extends One { public void method2 O { System. out . println ( "Three2" ) ; merhodl o ; ) ) public class Four extend,s Three { public void methodl O t System. out . print,ln ( "Fourl-', ) ; super.methodl O; t public void merhod3 ( ) System. out . println ) ) And assume the : One varl One var2 : One var3 : Three var4 Object var5 Object var6 { ( "Four3" ) ; folr-owing variabres have been defined: new Two O; new Three O; new Four ( ) ; : new Four ( ) ; new Three ( ) ; : new One O ; BehaviorT able Class One methodl method2 method3 Two Three Four ...
View Full Document

This note was uploaded on 11/03/2009 for the course CSE 143 taught by Professor Sr during the Spring '08 term at University of Washington.

Ask a homework question - tutors are online