| /*demo on assigning the variable to float data type*/
class App3{
} |
Note: In Java we cannot directly assign the values to the float variables. So, for declaring the variables we need the help of type casting. There are two types of syntax’s to convert the given value into the float data type. They are
|
- output:
- \>javac App3.java
- \>java App3
- The value of x is : 100.2323
