• Post Reply Bookmark Topic Watch Topic
  • New Topic

Core java integer value  RSS feed

 
ssasi kumar
Greenhorn
Posts: 26
Chrome Firefox Browser Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
public class Example {
public static void main(String[] args) {
int a = 012;
System.out.println(a);

}

}

wat will be the output for the above code?
 
Steve Luke
Bartender
Posts: 4181
22
IntelliJ IDE Java Python
  • Likes 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ssasi kumar wrote:public class Example {
public static void main(String[] args) {
int a = 012;
System.out.println(a);

}

}

wat will be the output for the above code?

Have you run it to see?
 
Campbell Ritchie
Marshal
Posts: 56584
172
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And what do you think the output will be?
 
ssasi kumar
Greenhorn
Posts: 26
Chrome Firefox Browser Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
it comes 10. why its come this answer?
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 16060
88
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You'll find the answer in section 3.10.1 of the Java Language Specification.
 
ssasi kumar
Greenhorn
Posts: 26
Chrome Firefox Browser Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks jasper
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!