Conversion Int from a String in Java

String strNumber = "42";
int number = Integer.parseInt(strNumber);