Hello,
I need the reason behind using (float) / 'f' keywords while defining a float variable in java...
eg. float f = 12.45f;
or
float f=(float)12.45;
instead of:
float f=12.45;
as we write in c++..
so i want to clear my concepts behind this reason that what is the difference between c++ and java regarding this declaration..why we cannot write it in the form as we write in c++...we have already mentioned to the compiler that it is a float type variable so why we need to specify this casting...
please reply me i m very confused...
thanks in advance
I need the reason behind using (float) / 'f' keywords while defining a float variable in java...
eg. float f = 12.45f;
or
float f=(float)12.45;
instead of:
float f=12.45;
as we write in c++..
so i want to clear my concepts behind this reason that what is the difference between c++ and java regarding this declaration..why we cannot write it in the form as we write in c++...we have already mentioned to the compiler that it is a float type variable so why we need to specify this casting...
please reply me i m very confused...
thanks in advance