This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan 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 Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "char c= Watch "char c= New topic
Author

char c='\101'; ..?

Prashant Neginahal
Ranch Hand

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


--------------<br />Prashant<br />SCJP-91%
James Chegwidden
Author
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
Sheriff

Joined: Oct 17, 2001
Posts: 4313

Check out the JLS, it explains �3.10.6 Escape Sequences for Character and String Literals:
OctalEscape:
\ OctalDigit
\ OctalDigit OctalDigit
\ ZeroToThree OctalDigit OctalDigit
OctalDigit: one of
0 1 2 3 4 5 6 7
ZeroToThree: one of
0 1 2 3
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: char c='\101'; ..?
 
Similar Threads
What is this
char initialization with unicode withouth the '\u'
Char representation
char
StringBuffer