> Hi,
> I am trying to make a if loop using a Int value contained in an Array
[quoted text clipped - 12 lines]
>
> Thanks
Are you trying to make a 2D array of Integer objects
Integer [][] array2D = new Integer[a][b];
or 2D array of int (primitive data type)
int[][] array2D = new int[a][b];
Lew - 05 Dec 2007 14:59 GMT
mnml <rdelsa...@gmail.com> wrote:
>> Hi,
>> I am trying to make a if loop using a Int value contained in an Array
[quoted text clipped - 10 lines]
>> if(array2D[a][a]==0)
>> ^
> Are you trying to make a 2D array of Integer objects
> Integer [][] array2D = new Integer[a][b];
> or 2D array of int (primitive data type)
> int[][] array2D = new int[a][b];
To the OP: Here's where an SSCCE
<http://www.physci.org/codes/sscce.html>
can be so very useful.
Notice that GArlington's question can only be answered by reference to the
code that you /didn't/ post.
An Integer or int array would've worked.
Another hint - the error message told you what was wrong. You were comparing
an Object to an int. What would have been comparable, if not Object to int?

Signature
Lew
mnml - 05 Dec 2007 16:53 GMT
> > Hi,
> > I am trying to make a if loop using a Int value contained in an Array
[quoted text clipped - 17 lines]
> or 2D array of int (primitive data type)
> int[][] array2D = new int[a][b];
thanks you.
> Hi,
> I am trying to make a if loop using a Int value contained in an Array
[quoted text clipped - 12 lines]
>
> Thanks
If is NOT a loop...
>Hi,
>I am trying to make a if loop using a Int value contained in an Array
>'array2D[a][a]'
>
> if(array2D[a][a]==0)
> dosomething();
see http://mindprod.com/jgloss/array.html
To compare, without auto unboxing, see
http://mindprod.com/applet/converter.html

Signature
Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com