String str = "324.12asdasd";
try {
Double d = new Double(str);
System.out.println("This is a digital");
}
catch(NumberFormatException e) {
System.out.println("This is not a digital");
}
try {
Double d = new Double(str);
System.out.println("This is a digital");
}
catch(NumberFormatException e) {
System.out.println("This is not a digital");
}
boolean isDigital(String str) {
try{
......
return true;
}
catch(){
return false;}
}