posted 21 years ago
The octal escape sequences \000 to \377 represent the same characters as the Unicode escape sequences \u0000 to \u00ff.
A character literal is expressed as a character or an escape sequence enclosed in single quotes: '1' '\u0031' '\061'
Try this,
char c1 = '\061';
char c2 = '\u0031'; //0x31 == 061
char c3 = '1';
char c4 = (char)49; //49 == 0x31 == 061
System.out.println(c1);
System.out.println(c2);
System.out.println(c3);
System.out.println(c4);
System.out.println("A very\061long\u0031string1of text");
int i1 = c1, i2 = c2, i3 = c3, i4 = c4;
System.out.println(i1);
System.out.println(i2);
System.out.println(i3);
System.out.println(i4);
[ July 27, 2003: Message edited by: Marlene Miller ]