-1

i have declared Long checkRandom=0101010101l; but when I am printing checkRandom it printed checkRandom==17043521 what was the reason its taking checkRandom=17043521 not checkRandom=0101010101

5
  • 6
    Numbers that start with a zero are treated as octal. Commented Jul 7, 2016 at 10:43
  • Or this one. Commented Jul 7, 2016 at 10:45
  • 1
    Seems more a duplicate of this to me. Commented Jul 7, 2016 at 10:45
  • 1
    @BackSlash there is a myriad of potential duplicate questions. Commented Jul 7, 2016 at 10:47
  • @squeamishossifrage yes you are right.thank you all Commented Jul 7, 2016 at 11:00

1 Answer 1

1

Just remove the leading 0:

Long checkRandom=101010101l
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.