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

Popular posts from this blog

jquery - How do you format the date used in the popover widget title of FullCalendar? -

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -