hex - convert a hexadecimal into a decimal via string convert in java -


i want convert string hexadecimal decimal value used integer.decode value hast written user.

package hexa; import java.util.scanner; public class hexa {     public static void main(string[] args) {         scanner in = new scanner(system.in);                 string str1;         system.out.print("ingrese el hexadecimal= ");         str1 = in.nextline();         system.out.println("from hex: " + integer.decode("#str1"));     } } 

use overloaded integer.parseint method takes second parameter radix:

integer.parseint(str1, 16); 

Comments

Popular posts from this blog

css - Which browser returns the correct result for getBoundingClientRect of an SVG element? -

gcc - Calling fftR4() in c from assembly -

.htaccess - Matching full URL in RewriteCond -