• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
  • Paul Clapham
Sheriffs:
  • paul wheaton
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Piet Souris
Bartenders:
  • Mike London

char.. play

 
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,
Can any1 pls.. explain 2 me how all the statements written below r true !!!
ch\u0061r a='a';
char \u0062 ='b';
char c ='\u0063';
"unicode characters can appear anywhere in the source code"----is this true?
THANKS IN ADV.
<marquee> Ratul Banerjee </marquee>
 
Ranch Hand
Posts: 1492
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Ratul,
The java compiler replaces all unicode characters with the ASCII alternative wherever possible. You can think of the unicode chars as escape codes. Therefore what actually gets compiled is the following lines:
char a = 'a';
char b = 'b';
char c = 'c';
And it all looks good to go!
Regards,
Manfred.
 
Ranch Hand
Posts: 103
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Manfred do you know what the r stands for in the first var. declaration? ch\u0061r a='a';
[This message has been edited by Michael Burke (edited March 24, 2001).]
 
Ranch Hand
Posts: 782
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If im not mistaken(that only happens 75 times daily though ) the r in :
ch\u0061r a='a';
stands for r. As in:
ch = ch ....u0061 = a ....r = r
 
Michael Burke
Ranch Hand
Posts: 103
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So it serves no purpose?
 
ratul banji
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,
Thanks all of u.
Butttttt...I am not clear enough...pls..explain me in details.
ooho...wht. is that r doing here...Andy. //ch\u0061r a ='a';
Thanks all ..1ce again.
Regds.
<marquee> Ratul Banerjee </marquee>

 
reply
    Bookmark Topic Watch Topic
  • New Topic