Using underscores in literals to improve code readability : Number Literal « JDK 7 « Java






Using underscores in literals to improve code readability



public class Test {
  public static void main(String[] args) {
    long debitCard = 1234_5678_9876_5432L;
    System.out.println("The card number is: " + debitCard);
  }
}

 








Related examples in the same category

1.Float number and underscore literal
2.Underscore binary literal