• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

What is this

 
Bob Young
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
class Test {
static char c = '\u0041'; // unicode, prints A
// char c = 65 decimal, prints A
// char c = 0101 octal, prints A
// char c = '\101' ?, prints A
public static void main (String[] args) {
System.out.println(c);
}
}

I have not seen a character defined as '/101'. What is it? It acts like octal, but does not have the leading 0 and it is in single quote. If I use and octal number, I do not need the single quote. 0101 (octal) is 65 decimal.
 
Barry Gaunt
Ranch Hand
Posts: 7729
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
See here
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic