permaculture playing cards*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes How to understand char declaration Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "How to understand char declaration" Watch "How to understand char declaration" New topic
Author

How to understand char declaration

shetal bansal
Ranch Hand

Joined: May 09, 2005
Posts: 63
Hi,
I have a doudt regarding char type variables intialization, i.e. how r the following declarations valid?

e.g
char c = '\061';
char c = '\61';

what does the escape character '\' signify?
Kedar Dravid
Ranch Hand

Joined: May 28, 2004
Posts: 333
We can use the escape sequence \ddd to specify a character literal by octal value, where each digit d can be any octal digit (0-7). The number of digits nust be 3 or fewer, and the octal value must not exceed \377, that is, only the first 256 characters can be specified with this notation.

e.g.: '\141', '\46'
shetal bansal
Ranch Hand

Joined: May 09, 2005
Posts: 63
thanks for the reply!!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to understand char declaration
 
Similar Threads
bitwise & operation on char variable
help me
char value assignment
Try my mock exam according to the latest version of the real exam
char declaration problem