Client Side Things
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsOther TechnologiesClient Side Things

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
  #1  
Old March 23rd, 2008, 02:07 PM
LeoCoderII LeoCoderII is offline
Registered User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Feb 2008
Posts: 9 LeoCoderII User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 12 m 4 sec
Reputation Power: 0
Question Javascript - Please help: JAVA crisis :)

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

Reply With Quote
  #2  
Old March 24th, 2008, 08:12 AM
Andrew's Avatar
Andrew Andrew is offline
Moderator
Click here for more information. Click here for more information
 
Join Date: Apr 2007
Location: United Kingdom
Posts: 1,945 Andrew User rank is Private First Class (20 - 50 Reputation Level)Andrew User rank is Private First Class (20 - 50 Reputation Level)  Folding Points: 2429 Folding Title: Novice Folder
Time spent in forums: 4 Days 5 h 58 m 47 sec
Reputation Power: 3
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

Reply With Quote
  #3  
Old March 24th, 2008, 03:46 PM
LeoCoderII LeoCoderII is offline
Registered User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Feb 2008
Posts: 9 LeoCoderII User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 12 m 4 sec
Reputation Power: 0
oooo thats a good idea.. thanks a lot i hadnt even thought about it.

Thanks again

Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesClient Side Things > Javascript - Please help: JAVA crisis :)


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT