I have a hexadecimal number in a String which is too large to convert to int and long and want to add the value of another hexadecimal number. So let's say I have this number:
String hex1 = "0xf27f2029f9c103f77be78b9591c1ab27167858d27d789cd3ea8a270c67ea5d91";
And want to add:
int hex2 = 0x1; or String hex2 = "0x1";
I know this question has been asked allready How to subtract or add two hexadecimal value in java but the answers don't work for me because they all involve conversion to int.
Stringto an integral type, then adding those twoString(s) will give you"0xf27f2029f9c103f77be78b9591c1ab27167858d27d789cd3ea8a270c67ea5d910x1"- which I bet you don't want.