[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 263
  • Last Modified:

integer too large issue!

Hi,
I am using jdk 1.4 jbuilder x to develop a small program.

When I compile my program it stops with an error -- integer number too large. The line it shows is

  public static final long MAX_VAL  = 4294967296;  

integer number too large: 4294967296

Although, long is 8 bytes signed (two's complement). Ranges from -9,223,372,036,854,775,808 to +9,223,372,036,854,775,807.

What can be the issue and how to resolve the same?
thanks,
rdh
0
rohitdivas
Asked:
rohitdivas
  • 2
1 Solution
 
objectsCommented:
try:

  public static final long MAX_VAL  = 4294967296L;  
0
 
zzynxSoftware engineerCommented:
Try
  public static final long MAX_VAL  = 4294967296L;  
0
 
objectsCommented:
integer constant is considered an int by default
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now