This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes char c='\101'; ..? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "char c= Watch "char c= New topic

char c='\101'; ..?

Prashant Neginahal
Ranch Hand

Joined: Dec 04, 2002
Posts: 76
char c='\101';
Here, how '\101' is in octal form and its decimal value is coming as 65...?
Hope someone will help..

--------------<br />Prashant<br />SCJP-91%
James Chegwidden
Ranch Hand

Joined: Oct 06, 2002
Posts: 201
Are you sure that's octal- octal starts with a 0 and hex 0x or 0X

Author and Instructor, my book
Sarma Lolla
Ranch Hand

Joined: Oct 21, 2002
Posts: 203
Yes. This is in octal format. A char can be assigned a value either in octal format or unicode format.
Jessica Sant

Joined: Oct 17, 2001
Posts: 4313

Check out the JLS, it explains �3.10.6 Escape Sequences for Character and String Literals:
\ OctalDigit
\ OctalDigit OctalDigit
\ ZeroToThree OctalDigit OctalDigit
OctalDigit: one of
0 1 2 3 4 5 6 7
ZeroToThree: one of
0 1 2 3
wood burning stoves
subject: char c='\101'; ..?
It's not a secret anymore!