public class StaticImportDemo {
public static void main(String[] args) {
String intValue = "123";
String dblValue = "567.80";
double resultValue = 0;
try {
resultValue = parseInt(intValue) + parseDouble(dblValue);
System.out.println("resultValueis " + resultValue);
}
catch (NumberFormatException e) {
System.out.println("EitherintValueor dblValuenot numeric");
}
}
}
public static void main(String[] args) {
String intValue = "123";
String dblValue = "567.80";
double resultValue = 0;
try {
resultValue = parseInt(intValue) + parseDouble(dblValue);
System.out.println("resultValueis " + resultValue);
}
catch (NumberFormatException e) {
System.out.println("EitherintValueor dblValuenot numeric");
}
}
}
No comments:
Post a Comment