Question
The following code compiles and runs without error. Use the following code to answer the matching questions below: //----------------------------------------------------------------- System.out.println(String A: + Hello.equalsIgnoreCase(HELLO!)); System.out.println(String
The following code compiles and runs without error. Use the following code to answer the matching questions below:
//-----------------------------------------------------------------
System.out.println("String A: " + "Hello".equalsIgnoreCase("HELLO!"));
System.out.println("String B: " + "Bah humbug!".indexOf("bug")); System.out.println("String C: " + "touppercase".toLowerCase());
//-----------------------------------------------------------------
double dblVal = 5.678; int intVal = 7; System.out.println("Expression A: " + 3 * (intVal - 1));
System.out.println("Expression B: " + intVal + (int)dblVal); System.out.println("Expression C: " + (intVal / (int)dblVal)); System.out.println("Expression D: " + intVal % (3 * intVal)); System.out.println("Expression E: " + (intVal >= (int)dblVal && intVal % intVal == 0)); System.out.println("Expression F: " + ((intVal % 4 == 1) && ((int)dblVal > (intVal * 2)))); System.out.println("Expression G: " + !(intVal != intVal)); System.out.println("Expression H: " + (int)(dblVal + .5));
//-----------------------------------------------------------------
Indicate the output which would be produced by the above code by matching the correct answer to the question. Note: Not all answers will be used and a given answer maybe used more than once.
String A: _____ String B: _____ String C: _____ Expression A: _____ Expression B: _____ Expression C: _____ Expression D: _____ Expression E: _____ Expression F: _____ Expression G: _____ Expression H: _____
A. 25
B. 0
C. 18
D. touppercase
E. TOUPPERCASE
F. false
G. 1
H. none of the provided answers are correct
I. 7
J. 19
K. 75
L. true
M. 6
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started