• 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
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

char assignment

 
Ranch Hand
Posts: 167
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,
I am new in this forum and have a basic question.
Why this code does not compile?

Thanks for your help.
 
Sheriff
Posts: 9109
12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Although this question is more frequently asked in the SCJP forum, when I did a search in this forum (using \u000A) I found several including:

this one with the following response

Originally posted by Mike Gershman:
If you put '\u000a' or '\u000d' in a source program, the compiler treats it as an actual line break in your program text and breaks your statement into two lines, both of which will probably have a syntax error.

You need to use '\n' or '\r'.



and these which may clarify further if you want more detail:

https://coderanch.com/forums/

https://coderanch.com/t/390266/java/java/Invalid-Chararcter-constant

https://coderanch.com/t/389165/java/java/uni-code
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic