Given: What is the result?
A.
true true
B.
true false
C.
false true
D.
false false
E.
Compilation fails
Explanation:
Given: What is the result?
Given: What is the result?
A.
true true
B.
true false
C.
false true
D.
false false
E.
Compilation fails
Explanation:
Code question:
public class Test {
public static void main(String[] args) {
Test ts = new Test();
System.out.print(isAvailable + ” “);
isAvailable = ts.doStuff();
System.out.println(isAvailable);
}
public static boolean doStuff() {
return !isASvailable;
}
static boolean isAvailable = false;
}
Output:
Exception in thread “main” java.lang.RuntimeException: Uncompilable source code – cannot find symbol
symbol: variable isASvailable
location: class Test
at Test.doStuff(Test.java:10)
at Test.main(Test.java:6)
false
Typo: return !isASvailable; => return !isAvailable;
Output:
false true
Answer: C