Solved

If X Is a Char and Values Is an Int

Question 44

Multiple Choice

If x is a char and values is an int array, then values[x]


A) causes a syntax error
B) causes an Exception to be thrown
C) casts x as an int based on x's position in the alphabet (that is, if x is an 'a' it uses 0 and if x is a 'z' it uses 25)
D) casts x as an int based on x's ASCII value (that is, if x is an 'a' it uses 97 and if x is a 'z' it uses 122)
E) casts x as an int based on the digit that is stored in x (that is, if x is a '3' it uses 3) but throws an Exception if x does not store a digit

Correct Answer:

verifed

Verified

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

Related Questions