Two Laptop Bag*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Representation of strings Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Representation of strings" Watch "Representation of strings" New topic
Author

Representation of strings

vinayak manda
Ranch Hand

Joined: Jul 27, 2004
Posts: 31
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

Joined: Aug 17, 2004
Posts: 76
Hop to the jls, section 3.10.5 String Literals

http://java.sun.com/docs/books/jls/second_edition/html/lexical.doc.html#101083
 
GeeCON Prague 2014
 
subject: Representation of strings