• 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:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

char a = '\u000A'

 
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Why is this invalid?
I thought the range for char is u0000 to uffff ?
apparently a and d are not valid...
can anyone tell me?
Thanks.
 
Ranch Hand
Posts: 1070
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This was explained in another posting, so you can do a search to find a more detailed answer. But the short of it is because the '\u000A' is the unicode for the return or \n. So what happens is that when you say:
char a = '\u000A'; you end up getting this:
char a =
;
because it returns to the next line and then types in your ;. So you always want to use \n instead.
Bill
 
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
We don't need to know this stuff for the exam do we?
Do we need to memorize which unicodes are valid and which are not
and what value each one has?
Is there a small subset of them that are well know that we definitly need to memorize?
 
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Mr Kourosh , you don't have to memorize anything for the exam.But your fundamentals and concepts should be clear enough.
------------------
Come on in !! Drinks are on the house in the Big Moose Saloon !!
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic