Hi,
Im new to JAVA and i have a question. The following code compiles fine and executes fine. But if you assign c = '\29'
, in the following code, the compilation fails.
1. How does JAVA interpret char c = '\21';
and char c = '\29';
, as escape sequence character?
2. Also char c = '3';
is valid and why not char c = '33';
class A1{
public static void main(String arg[]){
//char c = '\29';
char c = '\21';
System.out.println("value of c is: " + c);
}
}
Could some one explain me why?
thanks,
katharnakh.