KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > simple > MyClass2


1
2 package simple;
3
4 import java.awt.Dimension JavaDoc;
5 import java.awt.Rectangle JavaDoc;
6 import java.util.ArrayList JavaDoc;
7 import java.util.List JavaDoc;
8
9 class MyClass2 {
10     private int a;
11     private String JavaDoc b;
12     private double c;
13     private boolean d;
14     private Object JavaDoc e;
15     private Integer JavaDoc f;
16     private Integer JavaDoc g;
17     private Dimension JavaDoc dimen;
18     private Rectangle JavaDoc rect;
19     private List JavaDoc ints;
20
21     public int getA() { return a; }
22     public void setA(String JavaDoc a) { this.a = Integer.parseInt(a); }
23     public void setA(int a) { this.a = a; }
24
25     public String JavaDoc getB() { return b; }
26     public void setB(String JavaDoc b) { this.b = b; }
27     public void setB(int b) { this.b = Integer.toString(b); }
28     
29     private Object JavaDoc getG() {
30         return g;
31     }
32     
33     private void setG(Object JavaDoc value) {
34         g = (Integer JavaDoc)value;
35     }
36     
37     private static List JavaDoc listFactory() {
38         return new ArrayList JavaDoc();
39     }
40 }
41
Popular Tags