Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

octal values in int

 
Vishnu Prakash
Ranch Hand
Posts: 1026
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
int i1 = 07; ==> no error
int i2 = 08; ==> compiler error
int i3 = 09; ==> compiler error
int i4 = 010; ==> no error

Plese explain the above nature of output.
 
Mani Ram
Ranch Hand
Posts: 1140
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The valid octal numerals are 0,1,2,3,4,5,6 and 7.
So, you get an error when you try to assign something which is not a valid octal numeral.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic