Guest User

Untitled

a guest
Aug 18th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. public class BooleanResult {
  2.  
  3. public static void main(String[] args) {
  4.  
  5. int x = 5, y = 1;
  6.  
  7. //...that's why you're still single
  8. boolean yourWayResult = isXGreaterThanY(x, y);
  9. System.out.println(yourWayResult);
  10.  
  11. //..and this guy took your GF
  12. boolean impressiveWayResult = impressiveWay(x, y);
  13. System.out.println(impressiveWayResult);
  14. }
  15.  
  16. //...this code doesn't work if x = 1 and y = 1
  17. public static boolean isXGreaterThanY(int x, int y){
  18. if(x > y){
  19. return true;
  20. } else{
  21. return false;
  22. }
  23. }
  24.  
  25. //..the very godly way to write code that handles all kind of input
  26. public static boolean impressiveWay(int x, int y) {
  27. return x > y;
  28. }
  29.  
  30. }
Add Comment
Please, Sign In to add comment