Which code fragment, when inserted at line n1, enables the App class to print Equal?
A.
String str3 = str2;
if (str1 == str3)
B.
if (str1.equalsIgnoreCase(str2))
C.
String str3 = str2;
if (str1.equal...
Which three are advantages of the Java exception mechanism?
A. Improves the program structure because the error handling code is separated from the normal program function
B. Provides a set of standa...
A method is declared to take three arguments. A program calls this method and passes only two arguments. What is the results?
A. Compilation fails.
B. The third argument is given the value null.
C. T...
What is the output?
A.
planets
Earth
1
B.
[LPlanets.Planet;@15db9742
Earth
1
C.
[LPlanets.Planet;@15db9742
Planets.Planet@6d06d69c
1
D.
[LPlanets.Planet;@15db9742
Planets.Planet@6d06d69c
[LPlanets.Mo...
Assume that the system date is June 20, 2014. What is the result?
A.
date1 = 2014-06-20
date2 = 2014-06-20
date3 = 2014-06-20
B.
date1 = 06/20/2014
date2 = 2014-06-20
date3 = Jun 20, 2014
C. Compilat...
Which two code fragments, when inserted at // insert code here, enable the code to compile and print 12?
A. Calc c = new Calc();
int n3 = c.findMid(n1,n2);
B. int n3 = super.findMid(n1,n3);
C. Calc c...