Solved

What Does the Following Code Snippet Display? Char Ch1 =

Question 48

Multiple Choice

What does the following code snippet display? char ch1 = '\u0000';
Char ch2 = '\uffff';
Random generator = new Random() ;
For (int i = 0; i < 1000; i++)
{
If (i % 50 == 0)
{
System.out.println() ;
}
System.out.print((char) (ch1 + generator.nextDouble() * (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