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 6533339
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T10:06:48+00:00 2026-05-25T10:06:48+00:00

Possible Duplicate: Integer with leading zeroes Can someone please tell me what is going

  • 0

Possible Duplicate:
Integer with leading zeroes

Can someone please tell me what is going on here? When I initialize an int with leading zeroes the program does not ignore the zeroes and instead does some other operation I am unaware of.

int num = 0200;

System.out.println(num); // 128

System.out.println(033); // 27
  • 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-25T10:06:48+00:00Added an answer on May 25, 2026 at 10:06 am

    Sure – it’s treating it as an octal literal, as per the Java Language Specification, section 3.10.1:

    An octal numeral consists of an ASCII digit 0 followed by one or more of the ASCII digits 0 through 7 and can represent a positive, zero, or negative integer.

    OctalNumeral:
            0 OctalDigits
    
    OctalDigits:
            OctalDigit
            OctalDigit OctalDigits
    
    OctalDigit: one of
            0 1 2 3 4 5 6 7
    

    Note that octal numerals always consist of two or more digits; 0 is always considered to be a decimal numeral-not that it matters much in practice, for the numerals 0, 00, and 0x0 all represent exactly the same integer value.

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

Sidebar

Related Questions

Possible Duplicate: How can I pad an int with leading zeros when using cout
They think it is: Possible Duplicate: Integer with leading zeroes But if you check
Possible Duplicate: What’s the reason I can’t create generic array types in Java? HashSet<Integer>[]
Possible Duplicate: how can I convert String to Int ? Hi, I have the
Possible Duplicate: Haskell Error: Couldn't match expected type Integer&#39; against inferred type Int' How
Possible Duplicate: The most efficient way to implement an integer based power function pow(int,
Possible Duplicate: The most efficient way to implement an integer based power function pow(int,
Possible Duplicate: Why Java OutputStream.write() Takes Integer but Writes Bytes Why does the write()
Possible Duplicate: How can I convert an integer into its verbal representation? I am
Possible Duplicate: Does the size of an int depend on the compiler and/or processor?

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.