Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

q on character literals?

 
JayaSiji Gopal
Ranch Hand
Posts: 303
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I encounter a no of q on using character literals.

are we supposed to know each of wht the character literals represent?

i was solving a mock exam where char a = '\000D'
and char b = '\000A'

After solving the exam, i came to know tht a represents new line and b represents carraige return.

I know only this Big Farms Need Red Tractors.

Do i need to know each letter's unicode representation?
 
Mike Gershman
Ranch Hand
Posts: 1272
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I know only this Big Farms Need Red Tractors.


Please explain.
 
Saheed Adepoju
Ranch Hand
Posts: 267
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well i guess he's refering to the escape sequences! That's how Dan says we should remember the escape sequences.
\b:Big
\f:Farm
\n:Need
\r:Red
\t:Tractors
Pretty neat eh!
Saheed.
SCJP 1.4
SCJD 1.4(preparing..)
Imagination is better than Knowledge.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic