Browse DevX
Sign up for e-mail newsletters from DevX


Tip: Working with Long Integer Literals

Learn more about how to work with long integer literals in Java.


Literals of type long are expressed by adding an L suffix. For example:

 0L // The decimal number zero (type 'long')
1L // The decimal number one (type 'long')
2147483648L // The value of Integer.MAX_VALUE + 1
long big = 2147483648; // ERROR
long big2 = 2147483648L; // OK


Visit the DevX Tip Bank


Octavia Andreea Anghel is a senior PHP developer currently working as a primary trainer for programming teams that participate at national and international software-development contests. She consults on developing educational projects at a national level. She is a coauthor of the book "XML Technologies--XML in Java" (Albastra, ISBN 978-973-650-210-1), for which she wrote the XML portions. In addition to PHP and XML, she's interested in software architecture, web services, UML, and high-performance unit tests.
Thanks for your registration, follow us on our social networks to keep up-to-date