Advertisement
Go0dtry

Successul Run of Ballprogram

Jul 11th, 2012
25
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.39 KB | None | 0 0
  1.  
  2. package ball;
  3.  
  4. public class Ballprogram {
  5.  
  6. public static void main(String[] args)
  7. {
  8.  
  9.  
  10. Ball golfBall = new Ball();
  11.  
  12. golfBall.setColor("white");
  13. golfBall.setHardness("hard");
  14. golfBall.setSize("small");
  15.  
  16. Ball baseBall = new Ball();
  17.  
  18. baseBall.setColor("white");
  19. baseBall.setHardness("hard");
  20. baseBall.setSize("medium");
  21.  
  22. Ball soccerBall = new Ball();
  23.  
  24. soccerBall.setColor("green");
  25. soccerBall.setHardness("soft");
  26. soccerBall.setSize("large");
  27.  
  28. System.out.println( "GolfBall Properties: \n"+
  29. "Color = "+golfBall.getColor()+"\n"+
  30. "Hardness = "+golfBall.getHardness()+"\n"+
  31. "Size = "+golfBall.getSize());
  32.  
  33. System.out.println("");
  34.  
  35. System.out.println( "BaseBall Properties: \n"+
  36. "Color = "+baseBall.getColor()+"\n"+
  37. "Hardness = "+baseBall.getHardness()+"\n"+
  38. "Size = "+baseBall.getSize());
  39.  
  40. System.out.println("");
  41.  
  42. System.out.println( "SoccerBall Properties: \n"+
  43. "Color = "+soccerBall.getColor()+"\n"+
  44. "Hardness = "+soccerBall.getHardness()+"\n"+
  45. "Size = "+soccerBall.getSize());
  46.  
  47. }
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement