Advertisement
Guest User

Untitled

a guest
Jun 16th, 2019
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.46 KB | None | 0 0
  1. public static void main(String[] args) {
  2. int x, y, z;
  3.  
  4. x = 10;
  5. y = 20;
  6. z = 30;
  7.  
  8. // T T
  9. // T F
  10. // F T
  11. // F F
  12.  
  13. //SET A
  14. boolean a = (x < z) && (x == x);
  15. boolean b = (x < z) && (x == z);
  16. boolean c = (x == z) && (x < z);
  17. boolean d = (x == z) && (x > z);
  18. //SET B
  19. boolean aa = (x < z) & (x == x);
  20. boolean bb = (x < z) & (x == z);
  21. boolean cc = (x == z) & (x < z);
  22. boolean dd = (x == z) & (x > z);
  23.  
  24. }
  25.  
  26. public boolean longerThan(String input, int length) {
  27. return input != null && input.length() > length;
  28. }
  29.  
  30. public boolean longerThan(String input, int length) {
  31. return input != null & input.length() > length;
  32. }
  33.  
  34. // 2 == 2 will never get evaluated because it is already clear from evaluating
  35. // 1 != 1 that the result will be false.
  36. (1 != 1) && (2 == 2)
  37.  
  38. // 2 != 2 will never get evaluated because it is already clear from evaluating
  39. // 1 == 1 that the result will be true.
  40. (1 == 1) || (2 != 2)
  41.  
  42. boolean a = (x < z) && (x == x);
  43.  
  44. public static boolean getFalse() {
  45. System.out.println("Method");
  46. return false;
  47. }
  48.  
  49. public static void main(String[] args) {
  50. if(getFalse() && getFalse()) { }
  51. System.out.println("=============================");
  52. if(getFalse() & getFalse()) { }
  53. }
  54.  
  55. if (mystring != null && mystring.indexOf('+') > 0) {
  56. ...
  57. }
  58.  
  59. if ( denom != 0 && num / denom >10)
  60.  
  61. if ( c==1 & e++ < 100 ) d = 100;
  62.  
  63. ||
  64.  
  65. if(demon!=0&& num/demon>10)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement