View difference between Paste ID: QPS501GH and J4cr6U8U
SHOW: | | - or go back to the newest paste.
1
public class Main {
2
    public static void main(String args[]){
3
        Student s = new Student();
4
        Student b = new Student();
5
        Student d = new Student();
6
	List<Students> students = new ArrayList();
7
	students.add(s);
8
	
9
	List<Students> studentsWitnSurNamesStartsWithW = new ArrayList();
10
	for (Student student in students){
11
		if (student.getSurname.toLowerCase().startsWith("w")){
12
			studentsWitnSurNamesStartsWithW.add(student)
13
		}
14
	}
15
	studentsWitnSurNamesStartsWithW
16
        s.setName("Vasya", "Vasek", "Vasilko");
17-
    public String getName(){
17+
18-
        String N = name + " " + patronymic + " " + surname;
18+
19-
        return N;
19+
20
21
    }
22
23
}
24
public class Student {
25
    private String name;
26
    private String patronymic;
27
    private String surname;
28
29
30
public String getSurname(){
31
return this.surname;
32
}	
33
public String getPatronymic(){
34
return this.patronymic;
35
}
36
public String getName(){
37
return this.name;
38
}
39
    public String getFullName(){
40
        return getName() + " " + getPatronymic() + " " + getSurname();
41
    }
42
    public void setName(String name, String patronymic, String surname){
43
        this.name = name;
44
        this.patronymic = patronymic;
45
        this.surname = surname;
46
    }