Skip to content

Commit 1c6a8f0

Browse files
committed
Using underscores in numeric literals (added new examples)
1 parent d894d7a commit 1c6a8f0

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

java-9/src/main/java/com/ibrahimatay/JEP213MillingProjectCoin/UsingUnderscoresInNumericLiterals.java

+3
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ public static void main(String[] args) {
1414

1515
// int x4 = 052_; // Invalid; cannot put underscores at the end of a number
1616

17+
// double PI = 3_.14; // compilation error
18+
// double PI = 3._14; // // compilation error
19+
1720
//long socialSecurityNumber1 = 999_99_9999_L; // Invalid; cannot put underscores
1821

1922
long creditCardNumber = 6684_5678_9012_3456L;

0 commit comments

Comments
 (0)