Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Hello
- {
- public static void main (String a[])
- {
- Scanner input = new Scanner(System.in);
- System.out.print("Hello, what's your name? ");
- int name = input.nextInt();
- System.out.print ("How old are you? ");
- int age = input.nextInt();
- if (age > 18)
- System.out.println ("You're over 18. Enjoy your car!");
- goodBye();
- } // End of main meathod
- public static void goodBye ()
- {
- System.out.println ("Good Bye!");
- }
- } // End of Hello Program
Add Comment
Please, Sign In to add comment