KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > T846rm1c


1
2 interface T846rm1a {
3     void m();
4 }
5 abstract class T846rm1b implements T846rm1a {}
6 abstract class T846rm1c extends T846rm1b implements T846rm1a {
7     public static void main(String JavaDoc[] args) {
8         boolean ok = true;
9         try {
10             T846rm1a.class.getDeclaredMethod("m", null);
11         } catch (Exception JavaDoc e) {
12             System.out.println("missing m() in class a");
13             ok = false;
14         }
15         try {
16             T846rm1b.class.getDeclaredMethod("m", null);
17             System.out.println("bogus Miranda m() in class b");
18             ok = false;
19         } catch (Exception JavaDoc e) {
20         }
21         try {
22             T846rm1c.class.getDeclaredMethod("m", null);
23             System.out.println("bogus Miranda m() in class c");
24             ok = false;
25         } catch (Exception JavaDoc e) {
26         }
27         if (ok) System.out.print("OK");
28     }
29 }
30
Popular Tags