KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > FieldBaseTest


1 public class FieldBaseTest {
2
3     Point p1 = new Point();
4     Point p2 = new Point();
5
6     public static void main(String JavaDoc [] args){
7         FieldBaseTest f = new FieldBaseTest();
8         f.run();
9     }
10     
11     public void run(){
12         int i = 3;
13
14         p1.x = 9;
15         p1.y = 8;
16
17         p2.x = i;
18         p2.y = 4;
19
20         if ((p1.x - p2.x) > (p1.y - p2.y)){
21             p1.x = p1.y;
22         }
23     }
24
25     public void test(Point p){
26         if (p.x > 3){
27             p.y = 3;
28         }
29     }
30 }
31
32 class Point {
33
34     public int x;
35     public int y;
36 }
37
Popular Tags