-3

For some purpose, I want to convert the String to my Unicode to int or long or double. I just need a number. Can anyone tell me how can I do that?

VatsalSura
  • 926
  • 1
  • 11
  • 27
Anirudh Sohil
  • 43
  • 1
  • 7

1 Answers1

1

If you want to get primitive values, use :

Integer.parseInt("12");
Long.parseLong("1024");
Double.parseDouble("1.52");

If you want to get objects corresponding to these values (Integer object, Long object, etc), use :

Integer.valueOf("12");
Long.valueOf("1024");
Double.valueOf("4.17");
Ephi
  • 346
  • 2
  • 12