Java – Float Example

Float is primitive data type in java which can take decimal value. After decimal we have to add “f” character. Use of float in java is shown below.

Example of Float

public class FloatExampleJava {

    public static void main(String[] args) {

        float ft=123.67f;

        System.out.println("float primitive data type :"+ft);
    }
}

Output

float primitive data type :123.67

Tags:

Bookmark  

 

Leave a Reply

Security Code:

 

  Random Post