Skip to content

Commit 7df4d3d

Browse files
author
github-actions
committed
Google Java Format
1 parent aaf8211 commit 7df4d3d

File tree

3 files changed

+31
-31
lines changed

3 files changed

+31
-31
lines changed

FilteredAdultStudents.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
import java.util.ArrayList;
22

33
public class FilteredAdultStudents {
4-
private ArrayList<Student> students;
4+
private ArrayList<Student> students;
55

6-
public FilteredAdultStudents() {
7-
this.students = new ArrayList<>();
8-
}
6+
public FilteredAdultStudents() {
7+
this.students = new ArrayList<>();
8+
}
99

10-
public void add(Student student) {
11-
if (student.age > 18) {
12-
this.students.add(student);
13-
}
10+
public void add(Student student) {
11+
if (student.age > 18) {
12+
this.students.add(student);
1413
}
14+
}
1515

16-
public void printStudents() {
17-
this.students.forEach((student) -> System.out.println(student));
18-
}
16+
public void printStudents() {
17+
this.students.forEach((student) -> System.out.println(student));
18+
}
1919
}

FilteredTeenStudents.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
import java.util.ArrayList;
22

33
public class FilteredTeenStudents {
4-
private ArrayList<Student> students;
4+
private ArrayList<Student> students;
55

6-
public FilteredTeenStudents() {
7-
this.students = new ArrayList<>();
8-
}
6+
public FilteredTeenStudents() {
7+
this.students = new ArrayList<>();
8+
}
99

10-
public void add(Student student) {
11-
if (student.age < 18) {
12-
this.students.add(student);
13-
}
10+
public void add(Student student) {
11+
if (student.age < 18) {
12+
this.students.add(student);
1413
}
14+
}
1515

16-
public void printStudents() {
17-
this.students.forEach((student) -> System.out.println(student));
18-
}
16+
public void printStudents() {
17+
this.students.forEach((student) -> System.out.println(student));
18+
}
1919
}

Student.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
public class Student {
2-
public String name;
3-
public int age;
2+
public String name;
3+
public int age;
44

5-
public Student(String name, int age) {
6-
this.name = name;
7-
this.age = age;
8-
}
5+
public Student(String name, int age) {
6+
this.name = name;
7+
this.age = age;
8+
}
99

10-
public String toString() {
11-
return this.name + " " + this.age;
12-
}
10+
public String toString() {
11+
return this.name + " " + this.age;
12+
}
1313
}

0 commit comments

Comments
 (0)