public class SimpleObject {
|
|
public static int main() {
|
|
Point p = new Point();
|
|
p.x = 10;
|
|
p.y = 20;
|
|
|
|
System.out.println(p.x);
|
|
System.out.println(p.y);
|
|
|
|
int sum = p.x + p.y;
|
|
System.out.println(sum);
|
|
|
|
Point p2 = new Point();
|
|
p2.x = 5;
|
|
p2.y = 15;
|
|
|
|
int total = p.x + p2.x;
|
|
System.out.println(total);
|
|
|
|
return 0;
|
|
}
|
|
}
|