Abby wrote:
>
> In C, I can use unsigned char to define hex value. Plz see below:
>
> unsigned char c = 0x01;
>
> Does java has this data type or something similar? I have a reason
> that I need to declare many hex values inside the program. I'm
> thinking about migrating from C to Java. Please give me some advice.
> Thank you so much.
Your terminology is a little confused. Hex (hexidecimal) is just a number radix for
expressing binary values. char and unsigned char can both be expressed in hex.
You are apparently are looking for an unsigned value, probably 8 bit. Java doesn't have
anything exactly like that. The only unsigned value is 'char', but it is 16 bits. Even
so, char is good choice, though short (signed 16 bit) or int (signed 32 bit) will do.
--
Lee Fesperman, FirstSQL, Inc. (
http://www.firstsql.com)
================================================== ============
* The Ultimate DBMS is here!
* FirstSQL/J Object/Relational DBMS (
http://www.firstsql.com)