Posted By

joshnunn on 08/13/09


Tagged

basic test java classes learning


Versions (?)

RobotTest.java


 / Published in: Other
 

  1. public class RobotTest {
  2. public static void main(String[] args) {
  3. Robot robby = new Robot("Robby",104,"Smoking",false,1);
  4. Robot bender = new Robot("Bender",200,"Drinking",true,2);
  5. Robot vacuum = new Robot("Vacuulux",20,"Sucking",false,-1);
  6. Robot astro = new Robot("Toby",-80,"Playing too much",true,3);
  7.  
  8. robby.displayDetails();
  9. robby.addModule();
  10. robby.setBadHabit("Spitting");
  11. robby.addModule();
  12. robby.addModule();
  13. robby.setBadHabit("eating before swimming");
  14. robby.setBadHabit("dying");
  15. robby.displayDetails();
  16.  
  17. bender.displayDetails();
  18.  
  19. vacuum.displayDetails();
  20. vacuum.setBadHabit("breaking down");
  21. vacuum.addModule();
  22. vacuum.displayDetails();
  23.  
  24. astro.displayDetails();
  25. astro.addModule();
  26. astro.displayDetails();
  27.  
  28. }
  29. }

Report this snippet  

You need to login to post a comment.