Privacy Policy Terms Of Use. Copyright © 2006-2010 Java Tutorials and Examples.
Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.
- public class Q1 {
- public static void main(String args[]){
- int i = 010;
- System.out.println(i);
- }
- }
b. Program will give runtime error
c. Program will print 8
d. None of the above
Answer:
C is the correct choice. Program will not give compile time or runtime error. If int variable starts with 0, the number is considered to be octal and thus, it will print 8 instead of 10 when run.

Post new comment