HarrJ

B8 Day 7 AND sample

Sep 18th, 2022 (edited)
248
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. package mattroseb8wk2;
  2.  
  3. public class Day07E {
  4. public static void main(String[] args) {
  5. String userName = "admin";
  6. String password = "password";
  7. boolean cond1;
  8. boolean cond2;
  9. boolean isTrue = true;
  10.  
  11. cond1 = userName.equals("admin");
  12. cond2 = password.equals("12345");
  13.  
  14. System.out.println("cond1: " + cond1);
  15. System.out.println("cond2: " + cond2);
  16.  
  17. int num1 = 12;
  18. int num2 = 42;
  19. int num3 = 32;
  20. cond1 = num3 > num1;
  21. cond2 = num3 > num2;
  22. isTrue = cond1 && cond2;
  23. System.out.println("is num3 largest: " + isTrue);
  24. }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment