Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void main(String[] args) {
- int x, y, z;
- x = 10;
- y = 20;
- z = 30;
- // T T
- // T F
- // F T
- // F F
- //SET A
- boolean a = (x < z) && (x == x);
- boolean b = (x < z) && (x == z);
- boolean c = (x == z) && (x < z);
- boolean d = (x == z) && (x > z);
- //SET B
- boolean aa = (x < z) & (x == x);
- boolean bb = (x < z) & (x == z);
- boolean cc = (x == z) & (x < z);
- boolean dd = (x == z) & (x > z);
- }
- public boolean longerThan(String input, int length) {
- return input != null && input.length() > length;
- }
- public boolean longerThan(String input, int length) {
- return input != null & input.length() > length;
- }
- // 2 == 2 will never get evaluated because it is already clear from evaluating
- // 1 != 1 that the result will be false.
- (1 != 1) && (2 == 2)
- // 2 != 2 will never get evaluated because it is already clear from evaluating
- // 1 == 1 that the result will be true.
- (1 == 1) || (2 != 2)
- boolean a = (x < z) && (x == x);
- public static boolean getFalse() {
- System.out.println("Method");
- return false;
- }
- public static void main(String[] args) {
- if(getFalse() && getFalse()) { }
- System.out.println("=============================");
- if(getFalse() & getFalse()) { }
- }
- if (mystring != null && mystring.indexOf('+') > 0) {
- ...
- }
- if ( denom != 0 && num / denom >10)
- if ( c==1 & e++ < 100 ) d = 100;
- ||
- if(demon!=0&& num/demon>10)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement