//the method of char2int char ch = '1'; int n = ch - '0'; //the method of String2int String str = "1234"; int total; total = 0; for(int i = 0; i < str.length(); i++){ total *= 10; total += str.charAt(i) - '0'; }
//the method of String2int String str="1234"; int n = Integer.parseInt(str);
int n = 8373; String str1 = String.valueOf(n); System.out.println(str1); double dn = 8434.3434; String str2 = String.valueOf(dn); System.out.println(str2);