• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

unicode??

 
srikanth reddy
Ranch Hand
Posts: 252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1.4) Which one of the following are not valid character contants? [8]
Select any two.
(a)char c = '\u00001' ;
(b)char c = '\101';
(c)char c = 65;
(d)char c = '\1001' ;

here the values in option b and d are taken to be octal values ..how is it so??octal values should start with 0 ..right ...

please help

sri
 
Kris Krason
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In char values, it is not needed to have 0 in front of octal.
Every backslash with one, two, three is considered an octal value of char.

Here's a link to JLS
http://java.sun.com/docs/books/jls/third_edition/html/lexical.html#101089

As you may see, octal digits can be in this form :

\[0-9]
\[0-9][0-9]
\[0-3][0-9][0-9]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic