December 22, 2008 at 1:01 AM
public static void main(String args)
float f=4.5f; //ERROR ON FLOAT DECLARATION
you need to put f after 4.5 it is a float value na....so you need to put it in java.
December 22, 2008 at 4:13 AM
If you want to declare a decimal value in Java, it will be considered as double datatype by default. So to specifically mention a float datatype value you should add character 'f' or 'F' at the end of the value.
In your case it can be declared as float f=4.5f; or float f=4.5F;