parsing - how does parseLong method work in java? -
in below code cant understand how "cafebabe" string convert numbers ?
class string { public static void main (string [] args) { long l = long.parselong( "cafebabe" ,16); system.out.println(l); } } // 3405691582
can tell me how happening ? thanks
oxcafebabe = e * 16^0 + b * 16^1 + * 16^2 + b * 16^3 + e * 16^4 + f * 16^5 + * 16^6 + c * 16^7 (decimal)
in above calculation replace hexadecimal digits decimal representations, i.e. 10, b 11, c 12, e 14 , f 15
Comments
Post a Comment