What will be displayed as a result of executing the following code? int x = 6;
String msg = "I am enjoying this class.";
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 this class.
I AM ENJOYING THIS CLASS.
I am enjoying this class.
Character at index x = e
Msg has 24 characters.
B) I am enjoying this class.
I AM ENJOYING THIS CLASS.
I am enjoying this class.
Character at index x = e
Msg has 25 characters.
C) I am enjoying this class.
I AM ENJOYING THIS CLASS.
I am enjoying this class.
Character at index x = n
Msg has 24 characters.
D) I am enjoying this class.
I AM ENJOYING THIS CLASS.
I am enjoying this class.
Character at index x = n
Msg has 25characters.
Correct Answer:
Verified
Q41: Which of the following is not a
Q42: A value that is written into the
Q43: What will be displayed as a result
Q44: If x has been declared an int,
Q45: Every Java application program must have
A) a
Q47: To display the output on the next
Q48: Which of the following is not a
Q49: Which of the following cannot be used
Q50: What would be printed out as a
Q51: Which of the following is valid?
A) float
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents