File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes integer number too large Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Beginning Java
Reply Bookmark "integer number too large" Watch "integer number too large" New topic
Author

integer number too large

swapnil paranjape
Ranch Hand

Joined: May 15, 2005
Posts: 125
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

Joined: May 15, 2005
Posts: 125
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
Jesper de Jong
Java Cowboy
Bartender

Joined: Aug 16, 2005
Posts: 12928
    
    3

This issue doesn't seem to be about the SCJP exam. I will move it to a more appropriate forum for you.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 32694
    
    4
It should probably not be Long but long. And I see you remembered the L after the number.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: integer number too large
 
Similar Threads
getting batchupdate exception while inserting recored for second time...
converting from timestamp to date
org.hibernate.exception.GenericJDBCException: could not insert:
Date milliseconds
integer number too large: