Solved

What Will Be Displayed as a Result of Executing the Following

Question 54

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:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions

Unlock this Answer For Free Now!

View this answer and more for free by performing one of the following actions

qr-code

Scan the QR code to install the App and get 2 free unlocks

upload documents

Unlock quizzes for free by uploading documents