Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Representation of strings

 
vinayak manda
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which are valid/invalid and if so why?

String s = "\n";
String s1="\r";
String s2= "\u000a";
String s3 ="\u000d";
String s4="'\u0041'";
String s5="\u0041";
String s6 ="\uD7AF";
 
Louie van Bommel
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hop to the jls, section 3.10.5 String Literals

http://java.sun.com/docs/books/jls/second_edition/html/lexical.doc.html#101083
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic