Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class BooleanResult {
- public static void main(String[] args) {
- int x = 5, y = 1;
- //...that's why you're still single
- boolean yourWayResult = isXGreaterThanY(x, y);
- System.out.println(yourWayResult);
- //..and this guy took your GF
- boolean impressiveWayResult = impressiveWay(x, y);
- System.out.println(impressiveWayResult);
- }
- //...this code doesn't work if x = 1 and y = 1
- public static boolean isXGreaterThanY(int x, int y){
- if(x > y){
- return true;
- } else{
- return false;
- }
- }
- //..the very godly way to write code that handles all kind of input
- public static boolean impressiveWay(int x, int y) {
- return x > y;
- }
- }
Add Comment
Please, Sign In to add comment