• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

integer number too large

 
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Experts,

I was trying a program to convert the miliseconds we get after from date object (Post Jan 1970) to date object again. Here what I was trying and I am getting interger number too large error. I am using long datatype though. Please advice.



This is the out put:
C:\jdk1.5.0_17\bin>javac MillisecondToDate.java
MillisecondToDate.java:5: integer number too large: 1222402191823
long yourmilliseconds = 1222402191823;
^
1 error

 
swapnil paranjape
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey

I got this fixed. It shud be Long yourmilliseconds = 1222402191823L;

This is what happens when you are not in touch with programing for 3 years
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This issue doesn't seem to be about the SCJP exam. I will move it to a more appropriate forum for you.
 
Marshal
Posts: 79240
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It should probably not be Long but long. And I see you remembered the L after the number.
 
reply
    Bookmark Topic Watch Topic
  • New Topic