This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes int length=343  is 343 an integer literal or decimal literal??? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "int length=343  is 343 an integer literal or decimal literal???" Watch "int length=343  is 343 an integer literal or decimal literal???" New topic
Author

int length=343 is 343 an integer literal or decimal literal???

Vishal Hegde
Ranch Hand

Joined: Aug 01, 2009
Posts: 1055

int length=343 is it decimal or integer literal

its given in the book as an decimal example ,if it is decimal then how cum it doesnot have a decimal point??


http://www.lifesbizzare.blogspot.com || OCJP:81%
Rohit Aggarawal
Ranch Hand

Joined: Jun 26, 2009
Posts: 39
Numeric value is same for both and that's why it is treated as the decimal literal.


SCJP 6.0
SCBCD for JEE 5

Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 37926
    
  22
It means "decimal" as opposed to octal binary and hexadecimal.
It doesn't mean "decimal fraction".
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: int length=343 is 343 an integer literal or decimal literal???
 
Similar Threads
Converting String to Integer without losing leading zero's
Conversion
why the long value print 10 ,not 12 ?
Java double data type problem
legal statements