my dog learned polymorphism
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Did u all know this ?????? 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 "Did u all know this ??????" Watch "Did u all know this ??????" New topic

Did u all know this ??????

Padmaja Balaji
Ranch Hand

Joined: Jun 13, 2001
Posts: 122
Here is something which read from JLS :
The Java programming language specifies a standard way of transforming a program written in Unicode into ASCII that changes a program into a form that can be processed by ASCII-based tools. The transformation involves converting any Unicode escapes in the source text of the program to ASCII by adding an extra u-for example, \uxxxx becomes \uuxxxx-while simultaneously converting non-ASCII characters in the source text to a \uxxxx escape containing a single u.
This transformed version is equally acceptable to a compiler for the Java programming language ("Java compiler") and represents the exact same program. The exact Unicode source can later be restored from this ASCII form by converting each escape sequence where multiple u's are present to a sequence of Unicode characters with one fewer u, while simultaneously converting each escape sequence with a single u to the corresponding single Unicode character.
Implementations should use the \uxxxx notation as an output format to display Unicode characters when a suitable font is not available.
So, I tried with this simple program :
class trial
public static void main(String[] arg)
char c = '\u0061';
char d = '\uu0061';
System.out.println(c + ", " + d);
The output is a,a
How friendly they are, isn't it!!
- Paddy
I agree. Here's the link:
subject: Did u all know this ??????
It's not a secret anymore!