How to Create a Float Type in Java


In this example we will show the method to create a float type in Java.

Source Code

package com.beginner.examples;

public class FloatType {
  public static void main(String[] args) {
    float num = 4.28f; // float
    System.out.println(num);
  }
}

Output:

4.28
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments