Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Student {
- private String name
- private int age
- private Boolean fail
- void main(String Name, int Age, Boolean Fail) {
- this.name = Name
- this.age = Age
- this.fail = Fail
- }
- public static String getName() { return this.name; }
- public static String getAge() { return this.age; }
- public static String getFail() { return this.fail; }
- public static void setAge(int newAge) { if (newAge >= this.age) this.age = newAge }
- }
- public class Test {
- Student YOURNAME = new Student("YOURNAME", 17, false);
- System.out.println(YOURNAME.getName());
- Team newTeam = new Team(Student new Student("Peter", 21, false), Student new Student("Emily", 18, false));
- public static String getEldestStudent(Team team1) {
- if (team1.getStudent1().getAge() > team1.getStudent2().getAge()) {
- return team1.getStudent1().getName();
- } else {
- if (team1.getStudent1().getName() == team1.getStudent2().getName()) {
- return team1.getStudent1().getName();
- } else {
- return team1.getStudent2().getName();
- }
- }
- }
- public class Team {
- private static int numberOfTeams = 0;
- private Student student1;
- private Student student2;
- void main(Student Student1, Student Student2) {
- this.numberOfTeams++;
- public Team newTeam = new Team(Student1, Student2)
- this.student1 = Student1;
- this.student2 = Student2;
- }
- public static Student getStudent1() { return this.student1 };
- public static Student getStudent2() {return this.student2 };
- public static bool bothFail() {
- if (this.student1.getFail() and this.student2.getFail()) {
- return true } ;
- else {
- return false };
- public static int getNumberOfTeams() { return this.numberOfTeams };
- }
- public class Marks {
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement