KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > SuperClassTesting


1 public class SuperClassTesting {
2
3     int x = 9;
4
5     public static void main(String JavaDoc [] args) {
6         SuperClassTesting sc = new SuperClassTesting();
7         sc.run();
8     }
9
10     public void run(){
11         Integer JavaDoc int1 = new Integer JavaDoc(8);
12         work(int1);
13     }
14
15     public void work(Object JavaDoc o) {
16         System.out.println("Object method used");
17     }
18
19     public void work(Number JavaDoc n) {
20         System.out.println("Number method used");
21     }
22    
23 }
24
Popular Tags