Advertisement
cgorrillaha

Person Tester

Dec 1st, 2020
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class TestPerson {
  4. public static void main(String[] args) {
  5. Scanner s=new Scanner(System.in);
  6. //public Person(String fN, String lN, int age){
  7. Person p1=new Person("Charlie", "Gorrill", 45);
  8. Person p2=new Person("Mason", "Leonard-Gorrill", 11);
  9.  
  10. System.out.println(p1.toString());
  11. System.out.println(p2.toString());
  12.  
  13. p1.setfName("Lila");
  14. System.out.println(p1.toString());
  15. p1.setAge(14);
  16. System.out.println(p1.getAge());
  17. p1.setlName("Leonard-Gorrill");
  18. System.out.println(p1.getlName());
  19. }
  20. }
  21.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement