java - Conversion from char to byte -


how character converted byte in java? if write

char c=12; byte b=(byte)c; system.out.println(b); 

then result 12,as expected but... if,i write

char c='\u0012'; byte b=(byte)c; system.out.println(b); 

then result 18. how???

the \u0012 in hexadecimal format, value 18. 12 , have use \u000c .

example -

char c='\u000c'; byte b=(byte)c; system.out.println(b); >> 12 

Comments

Popular posts from this blog

How has firefox/gecko HTML+CSS rendering changed in version 38? -

android - CollapsingToolbarLayout: position the ExpandedText programmatically -

Listeners to visualise results of load test in JMeter -