Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package drivingage;
- public class DrivingAge {
- public static void main(String [] args) {
- String returnedString = methodName();
- int age = 16;
- }
- public static void forLoop(int age){
- String returnedString = methodName();
- for(int i = 0;i < age;i++){
- System.out.println("Age Counter: "+i);
- }
- }
- public static void ifElse(int age){
- String returnedString = methodName();
- if (age >= 16){
- System.out.println("Reached minimum age limit.");
- }else{
- System.out.println("Must wait until you reach the minimum age!");
- }
- }
- public static void switchMethod(int age){
- String returnedString = methodName();
- switch (16){
- case 1:
- System.out.println("You can not get your drivers license!");
- break;
- case 16:
- System.out.println("You can get your drivers license!");
- break;
- case 21:
- System.out.println("You should have your license by now!");
- default:
- System.out.println("I don't know what message to put here.");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement