value « hexadecimal « Java Data Type Q&A

1. Why use hex values instead of normal base 10 numbers?

I was looking over this code to calculate math.sqrt in Java. Why did they use hex values in some of the loops and normal values for variables? ...

2. Increment a Hex value (JAVA)

can you increment a hex value in Java? i.e. "hex value" = "hex value"++

3. compare hexadecimal values java

Duplicate: hi, i'm implementing x-modem protocol in java,i'm reading serialport and storing in byte array of size 1024. then i have converted data to string i'm getting 133 bytes in a ...

4. string to hex value

Is there any java utility to convert string to hex value (integer) ?

5. How do I get a value from an address using Java?

For an obfuscation program I am writing in Java, I need to find a way to get a value at a specific address. For example, in a program I opened in ...

6. Converting string to intger hex value "Strange" behaviour!

I have noticed java will not allow me to store large numbers such as 2000000000, i.e 2 billion obviously to an integer type, but if i store the corresponding hex value i.e ...

7. Large negative hex value conversion to long in java

the result should have a negative value, but its positive. How can I fix this? Thanks!! BigInteger b = new BigInteger("80000000000000004308000000000000", 16); System.out.println("long value: "+b.longValue()); --> long value: 4830110600354856960

8. Hexadecimal manipulation woes. Cannot reach expected value

I am supposed to merge the values of source and background arrays to get the value in expected (the answer array).

    int[][] source =     ...

9. How to subtract or add two hexadecimal value in java

Is there a way of calculating two hexadecimal value without converting it to int? for example:

String sHex = "f7c0";
String bHex = "040000000";

10. What does this hex (?) value mean / do??

Imagine "FFFF8000" as a binary number: it's seventeen ones followed by fifteen zeros. The expression "if((0xFFFF8000 & status) != 0)" means "if one or more of the first seventeen bits of 'status' are set to one..." This kind of code is generally used to pack a whole bunch of boolean flags into one int, to save space.

11. Value of hexadecimal 0xDeadCafe

an int is 32 bits (if i remember right). that give you 2^32 values, but they are not all positive. the first bit (leftmost) is used to represent the sign of the number. so, 1/2 of the 2^32 are negative, and 1/2 are non-negative (which includes 0). search around in this forum for "two's complement", and you see how negative numbers ...

12. Create String from BIG5 hex value

13. need help displaying hex values

14. check input values are available in Hex

how to check input values are available between 0x0000000000000001 to 0xFFFFFFFFFFFFFFFE i am using following code. but error will come public boolean hexCheck16(String hex) { String hex_min = "0x0000000000000001"; String hex_max = "0xFFFFFFFFFFFFFFFE"; int min1 = Integer.parseInt(hex_min.substring(2).toString(),16); int max2 = Integer.parseInt(hex_max.substring(2).toString(),16); int num = Integer.parseInt(hex.toString(), 16); if(num >= min1 & num <= max2) { return true; } else { return false; ...

15. incrementing hex values

Values are just values, they're not hexadecimal or octal or decimal or binary. (Well, they're all stored as a sequence of bits, so you could say that they're all binary in a sense, but the representation in characters is irrelevant to the values.) So just increment a variable normally, and if you so choose you can display it in hex.

16. 7, Even parity of Hex values??

17. Converting string to actual hex values

18. replacing hex values in a string

20. compare on hexadecimal value

21. String tokenizer and hex values

Hi there, I have been having trouble in tokenizing a hex value. 210000e08b0b34fa this is the hex value which is being sent from my client application. What I need to do is get this hex and store it in the Database. I am getting this as long value but what is happening is that string tokenizer takes only 210000 and the ...

22. Hex value representation & manupulation

23. adding hexadecimal values

I am importing from a flat file to a mysql db. I am having trouble with the primary keys. In the delimited file I read "x1234567887654321123456788765a321". This is a hexadecimal. I am trying to insert this value in a field of CHAR(16). Any ideas on how to solve this or where I might find the solution would be greatly appreciated.