Operators
© examsiri.com
Question : 4 of 23
Marks:
+1,
-0
Given:
What is the result?
1. public class ClassA {
2. public int getValue() {
3. int value=0;
4. boolean setting = true;
5. String title=”Hello”;
6. if (value || (setting && title == “Hello”)) { return 1; }
7. if (value == 1 & title.equals(”Hello”)) { return 2; }
8. }
9. }
And:
10. ClassA a = new ClassA();
11. a.getValue();What is the result?
Go to Question: