-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathCustType.java
43 lines (34 loc) · 857 Bytes
/
CustType.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
40
41
42
43
import java.util.ArrayList;
import java.util.List;
public class custtypeasargs
{
public static void main(String [] args)
{
String [] firstNames = {"Omar", "Angela", "Nouhaila", "Noor", "Alan"};
String [] lastNames = {"Belkady", "Cao", "Bahtat", "Zalila", "Ngo"};
List<User> users = new ArrayList<User>();
for(int j=0;j<firstNames.length;j++)
{
User o = new User();
o.setFirstName(firstNames[j]);
{
System.out.println(o.getFullName());
}
//Instantiate myCustTypeArgs because it is not static
Main n = new Main();
n.printUser(users.get(0));
}
//Method to take the user
public void printUser(User u)
{
//Reference the user object
System.out.println(u.getFullName());
}
o.setLastName(lastNames[j]);
users.add(o);
}
for(User o: users)
{
System.out.println(o.getFullName());
}
}