aspose file tools*
The moose likes Beginning Java and the fly likes Value of int i=012; Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Value of int i=012;" Watch "Value of int i=012;" New topic
Author

Value of int i=012;

Biju Warrier
Greenhorn

Joined: Mar 31, 2003
Posts: 2
public class Oct{
public static void main(String argv[]){
Oct o = new Oct();
o.amethod();
}
public void amethod(){
int oi= 012;
System.out.println(oi);
}
}
:roll: :roll:
karl koch
Ranch Hand

Joined: May 25, 2001
Posts: 388
tricky stuff to spot (unless the classname is Oct :-) )
starting with '0' indicates octal. 012 => 10
(1 * 8 + 2 * 1)
starting with '0x' indicates hex. 0x12 => 18
(1 * 16 + 2 * 1)
k
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Value of int i=012;