I'm going through the SCJP2 notes and subsequent mock exams
here and I'm getting answers that don't make sense to me. I was hoping someone could tell me why they are what they are.
(These are all from the first page)
Q17 An example unicode value is '0x3c0' in hexadecimal.
Which of the following correctly initializes the char primitive to the pi?
I say: b - char pi='\u03c0';
They say: a - char pi='u3c0';
I thought the Unicode value always began with a slash?
Q18 State the reason for a compile error caused by the following statement
String name="summertime \u00d wintertime"; I say: c - '\u00d' is not a valid unicode character
They say: b - escape sequences inserts the code for a line terminator. Line terminators are not allowed between opening and closing quotes
Since when can't you have a line break between quotes?
Thanks for any help,
g.
[ April 26, 2002: Message edited by: Garann
Rose Means ]
[ April 26, 2002: Message edited by: Garann Rose Means ]