• Post Reply Bookmark Topic Watch Topic
  • New Topic

What will be output  RSS feed

 
naveen jayant
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
it is printing 12, i could not understand how?
class TestOut
{
public static void main(String[] args)
{
int i=014;
System.out.println("valure of i:- " +i);
}
}
 
Joanne Neal
Rancher
Posts: 3742
16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Any int literal starting with zero is considered to be in octal format.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!