Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Java Data Type

Options
  • 10-06-2003 1:28pm
    #1
    Closed Accounts Posts: 536 ✭✭✭


    Hi I need to store an 8 byte digit in a Java Data Type.
    Can someone tell me what type will do this?

    a long is only 4 bytes yes?


Comments

  • Registered Users Posts: 1,931 ✭✭✭Zab


    No, a long is eight bytes in Java.

    Zab.


  • Registered Users Posts: 1,186 ✭✭✭davej


    A long is 64 bits in size.
    Also remember that all numeric types are signed.

    You may want to look at BigInteger or BigDecimal if you're looking for arbitrary precision.

    davej


  • Closed Accounts Posts: 536 ✭✭✭flyz


    thanks!


  • Registered Users Posts: 1,931 ✭✭✭Zab


    Actually, a char is an unsigned 16-bit number, which can be very handy at times.

    Unsigned variables would probably be close to the top of my Java wishlist.


  • Registered Users Posts: 68,317 ✭✭✭✭seamus


    Originally posted by Zab
    Actually, a char is an unsigned 16-bit number, which can be very handy at times.

    Unsigned variables would probably be close to the top of my Java wishlist.

    Well, as you no doubt know, you can unsign them using the >>> (or is it <<<) operator.

    An unsigned kweyword would be nice tho :(


  • Advertisement
Advertisement