Created
October 23, 2015 09:59
-
-
Save edinak1/79c7a0093c67410ffcb0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package metod; | |
| public class Old { | |
| public static void main(String[] args) { | |
| int age=212; | |
| if(age>150 || age<=0) | |
| System.out.println("Age are not correct"); | |
| else | |
| System.out.println(oldEnough(age)); | |
| ////////////////////////////////////////////// | |
| age=-5; | |
| if(age>150 || age<=0) | |
| System.out.println("Age are not correct"); | |
| else | |
| System.out.println(oldEnough(age)); | |
| ////////////////////////////////////////////// | |
| age=25; | |
| if(age>150 || age<=0) | |
| System.out.println("Age are not correct"); | |
| else | |
| System.out.println(oldEnough(age)); | |
| ////////////////////////////////////////////// | |
| age=12; | |
| if(age>150 || age<=0) | |
| System.out.println("Age are not correct"); | |
| else | |
| System.out.println(oldEnough(age)); | |
| } | |
| static boolean oldEnough(int age) | |
| { | |
| if(age>=21 && age<150) | |
| return true; | |
| return false; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment