-
Notifications
You must be signed in to change notification settings - Fork 0
/
Thisreference.java
39 lines (32 loc) · 959 Bytes
/
Thisreference.java
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
import java.util.Scanner;
public class Thisreference {
int day;
int month;
int year;
public void acceptRecord()
{
Scanner scanner =new Scanner(System.in);
System.out.println("Enter the day");
this.day=scanner.nextInt();
System.out.println("Enter the month");
this.month=scanner.nextInt();
System.out.println("Enter the year");
this.year=scanner.nextInt();
}
public void printRecord()
{
System.out.println(this.day+" / "+this.month+" / "+this.year);
}
public static void main(String... x)
{
Thisreference this1=new Thisreference();
Thisreference this2=new Thisreference();
Thisreference this3=new Thisreference();
this1.acceptRecord();
this2.acceptRecord();
this3.acceptRecord();
this1.printRecord();
this2.printRecord();
this2.printRecord();
}
}