Código PHP:
System.out.println(testNum("10.50"));
........
public static int testNum(String numero) {
int bol=0;
boolean bole=false;
int number ;
double num ;
try {
if(bole==false)
{
Integer.parseInt(numero);
bol=1; bole=true;
}
//System.out.println("it's integer");
}
catch (NumberFormatException e) {
//e.printStackTrace();
}
finally {
try {
if (bole==false)
{
Double.parseDouble(numero);
bol=3; bole=true;
}
}
catch(NumberFormatException e) {
e.printStackTrace();
}
finally {
return bol;
}
}
}