SHARE
TWEET

nothing...

a guest Dec 3rd, 2019 81 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public class Student {
  2.     private String name
  3.     private int age
  4.     private Boolean fail
  5.     void main(String Name, int Age, Boolean Fail) {
  6.         this.name = Name
  7.         this.age = Age
  8.         this.fail = Fail
  9.     }
  10.     public static String getName() { return this.name; }
  11.     public static String getAge() { return this.age; }
  12.     public static String getFail() { return this.fail; }
  13.     public static void setAge(int newAge) { if (newAge >= this.age) this.age = newAge }
  14. }
  15.  
  16. public class Test {
  17.    Student YOURNAME = new Student("YOURNAME", 17, false);
  18.    System.out.println(YOURNAME.getName());
  19.  
  20.    Team newTeam = new Team(Student new Student("Peter", 21, false), Student new Student("Emily", 18, false));
  21.  
  22.    public static String getEldestStudent(Team team1) {
  23.     if (team1.getStudent1().getAge() > team1.getStudent2().getAge()) {
  24.         return team1.getStudent1().getName();
  25.     } else {
  26.         if (team1.getStudent1().getName() == team1.getStudent2().getName()) {
  27.             return team1.getStudent1().getName();
  28.         } else {
  29.             return team1.getStudent2().getName();
  30.         }
  31.     }
  32. }
  33.  
  34. public class Team {
  35.    private static int numberOfTeams = 0;
  36.    private Student student1;
  37.    private Student student2;
  38.  
  39.  
  40.    void main(Student Student1, Student Student2) {
  41.     this.numberOfTeams++;
  42.        public Team newTeam = new Team(Student1, Student2)
  43.         this.student1 = Student1;
  44.         this.student2 = Student2;
  45.    }
  46.  
  47.    public static Student getStudent1() { return this.student1 };
  48.    public static Student getStudent2() {return this.student2 };
  49.  
  50.    public static bool bothFail() {
  51.       if (this.student1.getFail() and this.student2.getFail()) {
  52.          return true } ;
  53.       else {
  54.          return false };
  55.  
  56.  
  57.    public static int getNumberOfTeams() { return this.numberOfTeams };
  58.  
  59. }
  60.  
  61. public class Marks {
  62.  
  63. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top