Solved

What Does the Following Code Snippet Display

Question 48

Multiple Choice

What does the following code snippet display?
Char ch1 = '\ u0000';
Char ch2 = '\ uffff';
For (int i = 0; i < 1000; i++)
{
If (i % 50 == 0)
{
System.out.println() ;
}
System.out.print((char) (ch1 + Math.random() * (ch2 - ch1 + 1) ) ) ;
}


A) It displays random Unicode characters.
B) It displays random ASCII characters.
C) Nothing because it has compilation error.
D) It displays the hexadecimal characters between '0' and 'F'.

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