package com.myapp.test;
import static java.lang.Double.parseDouble;
import static java.lang.Integer.parseInt;
public class StaticImportTest {
public static void main(String[] args) {
String intValue = "123";
String dblValue = "567.89";
double resultValue = 0;
try {
resultValue = parseInt(intValue) + parseDouble(dblValue);
System.out.println("resultValueis " + resultValue);
} catch (NumberFormatException e) {
System.out.println("EitherintValueor" + " dblValuenot numeric");
}// rest of code
}
}
import static java.lang.Double.parseDouble;
import static java.lang.Integer.parseInt;
public class StaticImportTest {
public static void main(String[] args) {
String intValue = "123";
String dblValue = "567.89";
double resultValue = 0;
try {
resultValue = parseInt(intValue) + parseDouble(dblValue);
System.out.println("resultValueis " + resultValue);
} catch (NumberFormatException e) {
System.out.println("EitherintValueor" + " dblValuenot numeric");
}// rest of code
}
}