hi all, I try to run this program it gives the following error:
java.lang.NumberFormatException: Fpr input string: "jav" at java.lang.NumberFormatException.forInputString(Unknown Source) at java.lang.FloatingDecimal.readJavaFormatString(Unknown Source) at java.lang.Float.parserFloat(Unknown Source) at swing.myApplet.compareValue(myApplet:48)
String value = System.getProperty( propertyName ); if(propertyName.equals("java.version"))
zeile 48: if((float)(Float.parseFloat(((propertyName)).substring(0, 3))*10) > 12) { return true; } else { System.out.println("Your Java Version must be 1.2 or later!"); }
can anyone tell me what' wrong?? Thanks in advance
This is just a guess since i don't know what propertyValue contains. I would guess its something like "java 1.2" the substring you are extracting is (0,3) which would "java" or possibly "java" instead of what you should be trying to extract (the "1.2")...I would try changing the indices of your substring.