A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
Badass: Making Users Awesome
this week in the
Underscores in Numeric Literals doubt
Joined: Feb 09, 2012
Jun 26, 2012 05:11:54
int j=0x_52;//not valid int i=0_52; //(octal)why it is valid ? //rule:we cannot put underscore at the beginning of a number.
I've mindset that as 0x is used to represent hex number same as 0 at 0_52 is being used to represent octal number so actual number will be 52.Hence _ before 52 should not be valid.please help
Tell the difficulties that i am difficult.
Joined: Jul 20, 2005
Jun 26, 2012 05:26:48
Locking this one. Please continue this discussion in your other thread here
I agree. Here's the link:
subject: Underscores in Numeric Literals doubt
How many digits an octal number have ?
Range of Octals
Octal number conversion
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2015