Hi,
I'm getting a NullPointerException when I try to add x # of Integers and do a comparison.
I declare my variables like this:
Integer i1 = 0
Integer i2 = 0
Integer i3 = 0
.....
Integer i[x] = 0
I do some logic and assign values to those Integers:
i1= 1
i2 = 1 etc.....
when I try to do this:
if (i1 + i2 + i3 + i4 + .... + i[x] > n)
do something
It gives me a NullPointerException.
Is this kind of operation not allowed?
I tried using parentheses around like this but it give me a syntax error
Error: The method "if()" was not found..
if ((i1 + i2 + i3 + i4 + .... + i[x]) > n)
Any help would be appreciated.
Thanks.
Eunice