Java examples for Language Basics:Primitive Types
Use underscores in place of commas or decimals in larger numbers to make them more readable.
underscores cannot be placed at
public class Main { public static void main(String[] args) { int million = 1_000_000; int billion = 1_000_000_000; float ten_pct = 1_0f; double exp = 1_234_56.78_9e2; System.out.println(million); System.out.println(billion); System.out.println(ten_pct); System.out.println(exp);//from w w w .j a v a2s. co m } }