Create Float number and underscore literal in Java
Description
The following code shows how to create Float number and underscore literal.
Example
/*from www . j a v a 2 s . c o m*/
public class Main {
public static void main(String[] args) {
float minAmount = 5_000F;
System.out.println(minAmount);
float currentAmount = 5_250F;
System.out.println(currentAmount);
float withdrawalAmount = 500F;
System.out.println(withdrawalAmount);
}
}
The code above generates the following result.
Home »
Java Tutorial »
Java Data Type »
Java Tutorial »
Java Data Type »