The Source for Java Technology Collaboration


Home | Help | Changes | Index | Search | Go

int

The int primitive represents a 32 bit signed integer. The Integer object is a wrapper class for int.

Rules

  • An int can range in value from -231 to 231-1.
  • An int can be converted to a long, float or double without loss of information. This is known as a widening primitive conversion.
  • An int can be converted to a short, byte or char but only with an explicit cast and loss of information may result. This is known as a narrowing primitive conversion.
  • An int cannot be converted to a boolean.



Discussion about int

Topic IntPrimitive . { Edit | Ref-By | Printable | Diffs r1 | More }
 XML java.net RSS

Revision r1 - 31 Aug 2003 - 03:21:28 - Main.redwolf
Parents: Integer