class char_declaration {
public static void main (
String[] args) {
char a = 061;
char b = '\61';//1
char c = '\061'; //2
char d = 0x0031;
char e = '\u0031';
char f = 034;
char g=200;//this works
System.out.print(""+a+b+c+d+e+f+g);
}
}
//I can't understand how these two lines(1 And 2) are legal ways to declare
//char.plz tell me the general rule so that I don't make mistake in declaring char using octal format.A octal has leading zero that i know:-).
thanks.
/*
Reason given in the Chisholm answer:
All of the declarations are legal.
The first three are declared in octal format.
The fourth is declared as a hexadecimal literal.
The fifth is a unicode escape sequence. �
*/