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
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Java Data Type

  • 10-06-2003 12: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, Registered Users 2 Posts: 1,931 ✭✭✭Zab


    No, a long is eight bytes in Java.

    Zab.


  • Registered Users, Registered Users 2 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, Registered Users 2 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, Registered Users 2 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