-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPointProgram.java
More file actions
44 lines (35 loc) · 764 Bytes
/
PointProgram.java
File metadata and controls
44 lines (35 loc) · 764 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import java.util.*;
class PointProgram
{
int x;
int y;
public void display()
{
System.out.println("x=" + x);
System.out.println("y=" + y);
}
public PointProgram()
{
x = 0;
y = 0;
}
public PointProgram(int n)
{
x = n;
y = n;
}
public PointProgram(int n, int n2)
{
x = n;
y = n2;
}
public static void main(String[] arrstring)
{
PointProgram p0 = new PointProgram();
p0.display();
PointProgram p = new PointProgram(65,98);
p.display();
PointProgram p1 = new PointProgram(43);
p1.display();
}
}