Complete the code to parse a string into an integer.
int number = Integer.[1]("123");
The method parseInt converts a string to an integer.
Complete the code to parse a string into a double.
double value = Double.[1]("45.67");
The method parseDouble converts a string to a double value.
Fix the error in parsing a string to an integer.
int num = Integer.[1]("abc");
Only parseInt correctly parses strings to int, but "abc" will cause an exception at runtime.
Fill both blanks to parse a string to a double and assign it to a variable.
Double [1] = Double.[2]("3.14");
Variable name can be pi. valueOf returns a Double object from a string.
Fill all three blanks to parse an integer from a string and print it.
String str = "42"; int [1] = Integer.[2](str); System.out.[3]([1]);
Variable number stores the parsed int. parseInt converts string to int. println prints the value with a new line.
