File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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 The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript 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