-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCustomerTest.java
More file actions
27 lines (24 loc) · 965 Bytes
/
CustomerTest.java
File metadata and controls
27 lines (24 loc) · 965 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
package lesson3;
public class CustomerTest {
public static void main(String[] args){
Customer c1=new Customer("Leul","Tsige","123-45-67");
Customer c2=new Customer("Renuka","Mohanraj","987-64-32");
Customer c3=new Customer("Robert","Tom","012-13-11");
Address a1=new Address("1000Nw","Strayer","Washington DC","15512");
Address a2=new Address("815NE","Woodbridge","VA","22191");
Address a3=new Address("215 lake dr","Chicago","Illinois","1152");
c1.setBillingAddress(a1);
c2.setBillingAddress(a2);
c3.setBillingAddress(a3);
Customer[] customers=new Customer[3];
customers[0]=c1;
customers[1]=c2;
customers[2]=c3;
for(int i=0;i< customers.length;i++){
String a= customers[i].getBillingAddress().getCity();
if(a.equals("Chicago")){
System.out.println(customers[i]);
}
}
}
}