Win a copy of OCP Java SE 8 Programmer II Exam Study Guide this week in the OCP forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Difference between 1000000 and 1000000L  RSS feed

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I have seen people write 1,000,000 as 1000000 and as 1000000L. Is there a difference between the two? I've used System.out.println() to show me what their values are. They're the same. Why would someone want to use 1000000L instead of just 1000000?
 
Bartender
Posts: 5167
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Nathan and welcome to the Ranch!

You can read about that in the JLS: Integer Literals.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!