Multiple Choice
What will be displayed as a result of executing the following code? int x = 8;
String msg = "I am enjoying java.";
String msg1 = msg.toUpperCase() ;
String msg2 = msg.toLowerCase() ;
Char ltr = msg.charAt(x) ;
Int strSize = msg.length() ;
System.out.println(msg) ;
System.out.println(msg1) ;
System.out.println(msg2) ;
System.out.println("Character at index x = " +
Ltr) ;
System.out.println("msg has " + strSize +
" characters.") ;
A) I am enjoying java.
I AM ENJOYING JAVA.
I am enjoying java.
Character at index x = j
Msg has 20 characters.
B) I am enjoying java.
I AM ENJOYING JAVA.
I am enjoying java.
Character at index x = o
Msg has 20 characters.
C) I am enjoying java.
I AM ENJOYING JAVA.
I am enjoying java.
Character at index x = o
Msg has 19 characters.
D) I am enjoying java.
I AM ENJOYING JAVA.
I am enjoying java.
Character at index x = y
Msg has 19 characters.
Correct Answer:

Verified
Correct Answer:
Verified
Q24: A Java program will not compile unless
Q24: Both character literals and string literals can
Q25: Which Scanner class method reads a String?<br>A)
Q26: What will be displayed as a result
Q27: Which of the following statements correctly creates
Q30: Which of the following cannot be used
Q31: What is the result of the following
Q32: What is the result of the following
Q33: Given the declaration double r;, which of
Q34: If x has been declared an int,