-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathTestCustomer.java
More file actions
33 lines (33 loc) · 1.53 KB
/
Copy pathTestCustomer.java
File metadata and controls
33 lines (33 loc) · 1.53 KB
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
package JavaII;
import java.util.Arrays;
import java.util.Date;
import java.util.Scanner;
public class TestCustomer {
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
System.out.print("Enter the number of objects : ");
int num=sc.nextInt();
Customer [] cust=new Customer[num];
for(int i=0;i<cust.length;i++){
cust[i]=new Customer();
for(int j=0;j<i;j++){
cust[i].genCustomerId();
}
cust[i].setCustName("Bayer");
cust[i].setCustSurname("Tree");
cust[i].setCustAdd("173 Moo 6 Saimai Saimai Bangkok 10220");
cust[i].setCustPhone(new String[]{"0865881888","0819195895"});
cust[i].setCustBirth(new Date(94,1,24));
System.out.println("Cust ID : "+cust[i].getCustId());
System.out.println("Cust Name : "+cust[i].getCustName());
System.out.println("Cust Surname : "+cust[i].getCustSurname());
System.out.println("Cust Email : "+cust[i].getCustEmail());
System.out.println("Cust Address : "+cust[i].getCustAdd());
System.out.println("Cust Phone : "+Arrays.toString(cust[i].getCustPhone()));
System.out.println("Cust Birth : "+cust[i].getCustBirth().toLocaleString());
System.out.println("ToString : "+cust[i].toString());
System.out.println("---------------------------------------------------------");
}
}
}