Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6223265
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T08:27:34+00:00 2026-05-24T08:27:34+00:00

They think it is: Possible Duplicate: Integer with leading zeroes But if you check

  • 0

They think it is:

Possible Duplicate:
Integer with leading zeroes

But if you check Integer with leading zeroes then you will find that the question is asked if before the launch of jdk7 and therefore it has lower researching efforts. But in jdk7 there is some change and addition to the integers. Here are the answers which are up to date covering jdk7.

I’ve a code:

class Test{
    public static void main(String[] args){
        int x=09;
        System.out.println(x);
    }
}

On compilation it gives an error: integer number too large : 09

Why it do so?

Again, if I change the code to:

class Test{
    public static void main(String[] args){
        int x=012;
        System.out.println(x);
    }
}

Now the output is 10

Why it give the output 10 instead of 12?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T08:27:34+00:00Added an answer on May 24, 2026 at 8:27 am

    Numbers beginning with 0 are considered octal – and 9 is not an octal digit (but (conventionally) 0-7 are).


    Hexadecimal literals begin with 0x, e.g. 0xA.


    Up until Java 6, there was no literal notation for binary and
    you’ll had to use something like

    int a = Integer.parseInt("1011011", 2);
    

    where the second argument specifies the desired base.


    Java 7 now has binary literals.

    In Java SE 7, the integral types (byte, short, int, and long) can also be expressed using the binary number system. To specify a binary literal, add the prefix 0b or 0B to the number.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: Display numbers with ordinal suffix in PHP I think they are called
Here are two different questions but I think they are related. When using Git,
My boss believes that wizards make things simple for the user. I think they
Some of the fellows in the office think that when they've added threads to
Possible Duplicate: Copy to Output Directory copies folder structure but only want to copy
Possible Duplicate: Resharper: vars Is there a reason that resharper suggests var thing1 =
Possible Duplicate: Java garbage collector - When does it collect? When people say that
Possible Duplicate: check what files are open in Python Hello, Is it possible to
Possible Duplicate: How will I know when to create an interface? Hi guys, This
Is it possible in jQuery or CSS (since I think they use the same

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.