Results 1 to 2 of 2
  1. #1
    susan is offline Member
    Join Date
    Jul 2007
    Posts
    44
    Rep Power
    0

    Default Help with Integer in java

    I'm just wondering because this has been bothering me for a while,

    Does an integer become truncated or does it round up?

    Example:
    Java Code:
     (Int)14.7
    Does it become 14 or 15?

    Thanks

  2. #2
    ritwik07 is offline Member
    Join Date
    Jul 2007
    Posts
    4
    Rep Power
    0

    Thumbs up

    It becomes 14 !

    and moreover the code should be:
    Java Code:
    x=(int)14.7;
    small "i" with int!!

Similar Threads

  1. Breaking down an integer
    By Emily in forum New To Java
    Replies: 1
    Last Post: 03-06-2008, 06:39 PM
  2. Integer Usage
    By bluegreen7hi in forum New To Java
    Replies: 11
    Last Post: 01-24-2008, 08:54 AM
  3. VeryLong Integer.. help
    By hey in forum New To Java
    Replies: 4
    Last Post: 12-14-2007, 09:48 PM
  4. Short/Integer
    By mew in forum New To Java
    Replies: 3
    Last Post: 12-06-2007, 09:28 PM
  5. Integer vs int
    By bugger in forum New To Java
    Replies: 1
    Last Post: 11-14-2007, 09:13 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •