Richa Sharma wrote:
What is the max numbers i can store as octal.

This is the range for 32 bit int
–2,147,483,648 to 2,147,483,647
So you can see, the maximum int type is 2,147,483,647(decimal) and convert it into Octal

As Jesper Young correctly pointed out, you can represnt integer or long numbers in octal.
To represent a long number in octal; simply add L at the end of number literal.

Interestingly, these two assignments are actually legal in java...

This is because octal (and hex) were historically used for bit masks -- that Java allows you to actually assign all the bits, including the negative bit, as if it was an unsigned number.