Java7 Underscores in Numeric Literals

Tutorials Shared by the Internet Community

Advertisements


Synopsis

Java7 Underscores in Numeric Literals - Java Tutorials Corner

Statistics

  • Total Hits - 26883

  • Total Votes - 4 votes

  • Vote Up - 2 votes

  • Vote Down - 2 votes

  • Domain - www.javatutorialcorner.com

  • Category - JAVA/Core JAVA

  • Submitted By - Appu T

  • Submitted on - 2014-03-16 08:56:13

Description

In this tutorial we are going to see underscores in numerical literals. Note: In this tutorial some of code taken from Oracle official web site In Java7 any number of underscore character (_) can appear in anywhere between numerical literals.The underscore is only present in the representation of literals in Java code, it will not appear if you print the literal value. Example int i = 1000_1000; Output 10001000 Examples to use underscore between numerical liters. long creditCardNumber = 1234_5678_9012_3456L; long socialSecurityNumber = 999_99_9999L; float... ...


Site  |   Broken  |   Tweet  |   Facebook  |     |   Save  |   Liked  |   Down

Advertisements