Page 1 of 1

[HD-OCP17/21-Fundamentals Pg 0, Sec. 2.3.3 - literals]

Posted: Mon Sep 23, 2024 4:54 pm
by joaoclopes
Hello, just wanted to add here:
To make it easy to read and comprehend large numbers, Java allows underscores in numeric literals. For example, 1000000.0 can also be written as 1_000_000.0. You cannot start or end a literal with an underscore. You can use multiple underscores consecutively. You need not worry about the rules governing the usage of underscores in hexadecimal, binary, and octal number formats.
You can't also use underscores before or after the dot "." on the double or float literal.

Thanks for the amazing book!

Re: [HD-OCP17/21-Fundamentals Pg 0, Sec. 2.3.3 - literals]

Posted: Tue Sep 24, 2024 4:10 am
by admin
True. Should be mentioned.
thank you for your feedback!

P.S. Do mention your full name so that your feedback can be acknowledged in the book.

Re: [HD-OCP17/21-Fundamentals Pg 0, Sec. 2.3.3 - literals]

Posted: Tue Sep 24, 2024 4:13 pm
by joaoclopes
Thanks for the fast response!

My full name is João Carvalho Lopes.

Thanks!

Re: [HD-OCP17/21-Fundamentals Pg 0, Sec. 2.3.3 - literals]

Posted: Wed Sep 25, 2024 12:50 am
by admin
Great. Your name will be there in the next build.