Advertisement
Go0dtry

DrivingAge / dont know how to call.

Jul 16th, 2012
31
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.36 KB | None | 0 0
  1. package drivingage;
  2.  
  3.  
  4. public class DrivingAge {
  5.  
  6.  
  7. public static void main(String [] args) {
  8.  
  9. String returnedString = methodName();
  10.  
  11. int age = 16;
  12. }
  13. public static void forLoop(int age){
  14.  
  15. String returnedString = methodName();
  16.  
  17. for(int i = 0;i < age;i++){
  18. System.out.println("Age Counter: "+i);
  19. }
  20.  
  21.  
  22. }
  23.  
  24.  
  25. public static void ifElse(int age){
  26.  
  27. String returnedString = methodName();
  28.  
  29. if (age >= 16){
  30. System.out.println("Reached minimum age limit.");
  31. }else{
  32. System.out.println("Must wait until you reach the minimum age!");
  33. }
  34. }
  35.  
  36.  
  37. public static void switchMethod(int age){
  38.  
  39. String returnedString = methodName();
  40. switch (16){
  41. case 1:
  42. System.out.println("You can not get your drivers license!");
  43. break;
  44. case 16:
  45. System.out.println("You can get your drivers license!");
  46. break;
  47. case 21:
  48. System.out.println("You should have your license by now!");
  49. default:
  50. System.out.println("I don't know what message to put here.");
  51. }
  52. }
  53. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement