
class EscapeSequence1 {
public static void main(String args[]) {
char ch='\141'; //this works correctly
char ch2='\777'; //this line give compile time error listed below
System.out.println("ch is:"+ch);
System.out.println("ch2 is:"+ch2); }
}
output is:::..
javac EscapeSequence1.java
javac EscapeSequence1.java
Process started >>>
EscapeSequence1.java:6: error: unclosed character literal char ch2='\777'; //this line give compile time error listed below ^
EscapeSequence1.java:6: error: unclosed character literal char ch2='\777'; //this line give compile time error listed below ^
EscapeSequence1.java:6: error: not a statement char ch2='\777'; //this line give compile time error listed below ^
3 errors
<<< Process finished
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.