forked from ayonious/Java-Best-Practices-Java8
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPerson.java
More file actions
37 lines (28 loc) · 668 Bytes
/
Person.java
File metadata and controls
37 lines (28 loc) · 668 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
package lamda.Example2;
import java.util.ArrayList;
import java.util.List;
public class Person {
private String givenName;
private String surName;
private int age;
private String eMail;
private String phone;
private String address;
private String gender;
public Person(String sur) {
surName = sur;
}
public void printName() {
System.out.println(surName);
}
public static List<Person> createShortList() {
List<Person> people = new ArrayList<>();
people.add(new Person("z"));
people.add(new Person("x"));
people.add(new Person("c"));
return people;
}
String getSurName() {
return surName;
}
}