KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > testlib > MethodsChange


1 package testlib;
2
3 import java.io.IOException JavaDoc;
4
5 public class MethodsChange
6 {
7     private int priv;
8     
9     static
10     {
11     System.out.println("static initializer");
12     }
13
14     {
15     System.out.println("non-static initializer");
16     }
17
18     public MethodsChange()
19     {
20     priv = 2;
21     }
22
23     protected MethodsChange(int initialpriv)
24     {
25     priv = initialpriv;
26     }
27
28     public int getPriv()
29     {
30     return priv;
31     }
32
33     public int getPriv2()
34     {
35     return priv;
36     }
37
38     public Integer JavaDoc getPrivAsInteger()
39     {
40     return new Integer JavaDoc(priv);
41     }
42
43     public Number JavaDoc getPrivAsNumber()
44     {
45     return new Integer JavaDoc(priv);
46     }
47
48     public void printPriv()
49     {
50     System.out.println(priv);
51     }
52
53     public void removedMethod(String JavaDoc x)
54     {
55     }
56
57     public void weakenParamType(String JavaDoc s)
58     {
59     }
60
61     public void strengthenParamType(Object JavaDoc s)
62     {
63     }
64
65     public void changeParamType(String JavaDoc s)
66     {
67     }
68
69     public void throwIOException() throws IOException JavaDoc
70     {
71     throw new java.io.IOException JavaDoc();
72     }
73
74     public void throwException() throws Exception JavaDoc
75     {
76     throw new java.io.IOException JavaDoc();
77     }
78
79     public void throwException2() throws Exception JavaDoc
80     {
81     throw new Exception JavaDoc();
82     }
83
84     public void throwRuntimeException() throws RuntimeException JavaDoc
85     {
86     throw new RuntimeException JavaDoc();
87     }
88
89     public void throwNoRuntimeException()
90     {
91     }
92
93     public void throwNoException()
94     {
95     }
96
97     /** This method will be deprecated in the later version. */
98     public void becomesDeprecated()
99     {
100     }
101
102     /**
103      * This method will be "undeprecated" in the later version.
104      *
105      * @deprecated this is a bad method.
106      */

107     public void becomesUndeprecated()
108     {
109     }
110     
111     public final void becomesNonFinal()
112     {
113     }
114     
115     public void becomesFinal()
116     {
117     }
118 }
119
Popular Tags