Well, Mr.ajb has resolved and pointed out the error in your code.
Coming to the second part of the code, that is, converting a string with letters to decimal integer below is code for that,
import java.util.Scanner;
public class HexaToDecimal
{
int number;
void getValue()
{
Scanner sc = new Scanner(System.in);
System.out.println("Please enter hexadecimal to convert: ");
number = Integer.parseInt(sc.nextLine(), 16);
sc.close();
}
void toConvert()
{
String decimal = Integer.toString(number);
System.out.println("The Decimal value is : " + decimal);
}
public static void main(String[] args)
{
HexaToDecimal htd = new HexaToDecimal();
htd.getValue();
htd.toConvert();
}
}
You can refer example on hexadecimal to decimal for more information.