|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
I am new to JAVA so dont laugh..
I am trying to compare two arrays and see if they are the same or not. my two arrays are: the drawnInt is what the computer randomly selects and then the inputInt array is what the user inputs. For the comparing method i have: public static boolean equals(int[]drawnInt, int[]inputInt) { boolean result = false; if( drawnInt == inputInt) { * for(int a = 0; a < drawnInt ; a++) * { for(int c = 0; c< drawnInt[a]; c++) { if(drawnInt[a][c] == inputInt[a][c]) result = true; else result = false; } } System.out.println(result); } However, the bit i have put in ** this is the bit i am having trouble with. It tells me i cant put an array here and it has to be an Int. i have tried declaring the array as an int and doing that but that just confuses things. Has anyone got a better way of doing this or can help at all? all help is muchly appreciated lol |
|
#2
|
||||
|
||||
|
I don't know Java but it appears that you need to count the number of elements in the array. In PHP it would be done with count(). Is there not a similar function in Java, there should be....
Sorry I can't be of more help...
__________________
Ubuntu User #13389 |
|
#3
|
|||
|
|||
|
oooo thats a good idea.. thanks a lot i hadnt even thought about it.
Thanks again |
![]() |
| Viewing: Codewalkers Forums > Other Technologies > Client Side Things > Javascript - Please help: JAVA crisis :) |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|