Advertisement
Guest User

Main

a guest
Dec 6th, 2015
3,170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.41 KB | None | 0 0
  1. public class testPerson
  2. {
  3.  
  4.     public static void main(String[] args)
  5.     {
  6.    
  7.         MyDate date = new MyDate(3, 3, 2015);
  8.        
  9.  Person person = new Person("Johnny", "123 Maple Street", "000-000-0000", "Johnny@yahoo.com"); //super class(name, address, number, email address)
  10.  
  11.  
  12.  Person student = new Student("Pam", "321 Emerson Dr.", "111-111-1111", "Pam@yahoo.com", "Freshman"); //subclass of Person (name, address, number, email, class status)
  13.  
  14.  
  15.  Person employee = new Employee("Sammy", "555 Java street", "222-222-2222", "Sammy@yahoo.com",
  16.          "office 1A", "$50000", date); //subclass of Person (name, address, number, email, office, salary, date hired)
  17.  
  18.  
  19.  Person faculty = new Faculty("Maddie", "333 Dog Street", "333-333-3333",
  20.          "Dogpark@yahoo.com", "Office 2B", "$30000", date, "7-2", "rank"); //subclass of Employee (name, address, number, email, office, salary, date hired, office hours, rank)
  21.  
  22.  
  23.  Person staff = new Staff("Dell", "932 Dell Street", "444-444-4444", "Dell@yahoo.com",
  24.          "office 3C", "$20000", date, "title"); //subclass of Employee (name, address, number, email, office, salary, date hired, title)
  25.  
  26.  
  27.  System.out.println(person.toString() + "\n");
  28.  System.out.println(student.toString() + "\n");
  29.  System.out.println(employee.toString() + "\n");
  30.  System.out.println(faculty.toString() + "\n");
  31.  System.out.println(staff.toString() + "\n");
  32.     }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement