basta fare
codice:
double x=Double.parseDouble(stringa);
mentre per un int
codice:
int x=Integer.parseInt(stringa);