• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

IS such TYPE OF QUESTION ASKED IN SCJP REAL EXAM :((

 
Karu Raj
Ranch Hand
Posts: 481
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
public class TechnoSample {
public static void main(String[] args) {
String s = "\u0048ello\u000aWorld!";
System.out.println(s);
}
}
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You should know the acceptable range of Unicode values (so that you can recognize whether they're valid), but you should not be expected to translate these into chars.
 
Thomas De Vos
stable boy
Ranch Hand
Posts: 425
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to understand that during compilation the Unicode characters are transformed to their ASCII representation and therefore can cause compilation errors.

Example:

It is illegal to write: '\u000a' // This is the Line Feed character
[ December 23, 2005: Message edited by: Thomas De Vos ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic