Skip to content

Instantly share code, notes, and snippets.

@alexejVasko
Created February 17, 2016 12:16
Show Gist options
  • Save alexejVasko/32f20c79efca34b70795 to your computer and use it in GitHub Desktop.
Save alexejVasko/32f20c79efca34b70795 to your computer and use it in GitHub Desktop.
package logic;
public class If {
public static void main(String[] args) {
System.out.print("Esche ne rodilsya(-4 goda) - ");
System.out.println(oldEnough(-4));
System.out.print("5 let - ");
System.out.println(oldEnough(5));
System.out.print("20 let - ");
System.out.println(oldEnough(20));
System.out.print("21 god - ");
System.out.println(oldEnough(21));
System.out.print("90 let - ");
System.out.println(oldEnough(90));
}
static boolean oldEnough(int age){
boolean x=false;
if(age >= 21){
x = true;
}
return x;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment