| | |
Simple problem
Thread Solved
![]() |
•
•
Join Date: Apr 2006
Posts: 114
Reputation:
Solved Threads: 0
Can someone tell me how to correct this?
This is so simple that I cannot figure out what the problem is. I need "OK" to print if the getName() equals name. If they do not equal print "Is not included".
I normally don't have problems with this but I have swapped and tried everything, I know that is is something simple.
Thank you,
Java Syntax (Toggle Plain Text)
for(int i = 0; i < 7; i ++) { if(team.group.toys[i].getName().equalsIgnoreCase(name ) { team.insert(team.group.toys[i].getDescrip()); System.out.println("OK"); } } System.out.println("Is not included.");
This is so simple that I cannot figure out what the problem is. I need "OK" to print if the getName() equals name. If they do not equal print "Is not included".
I normally don't have problems with this but I have swapped and tried everything, I know that is is something simple.
Thank you,
Java Syntax (Toggle Plain Text)
String result = "Is not included."; for(int i = 0; i < 7; i ++) { if(team.group.toys[i].getName().equalsIgnoreCase(name ) { team.insert(team.group.toys[i].getDescrip()); result = "OK"; break; // no reason to keep looking here } } System.out.println(result);
Last edited by Ezzaral; Mar 5th, 2008 at 6:25 pm.
![]() |
Similar Threads
- Installing Windows 98 On VMware. Floppy problem (Windows 95 / 98 / Me)
- Help me with this Simple Problem plss (C)
- BUTTON DOES NOT WORK??? simple problem (C)
- Help with simple problem (C++)
- Simple problem regardingform elements (ASP)
- Mac Mouse Problem! Help me out? (OS X)
Other Threads in the Java Forum
- Previous Thread: can you help, please
- Next Thread: Encoding problem
| Thread Tools | Search this Thread |
-xlint actionlistener add android applet application array automation bank bi binary blackberry block bluetooth character class client code compile compiler component consumer database desktop developmenthelp eclipse equation error event fractal ftp functiontesting game gameprogramming givemetehcodez graphics gui health html hyper idea image infinite int j2me j2seprojects java javac javaee javame javaprojects jetbrains jni jpanel jtable julia learningresources lego linked linux mac main method mobile myregfun netbeans notdisplaying number online pearl printf problem program qt researchinmotion rotatetext rsa scanner screen server set singleton sms sort spamblocker sql string swing system textfields thread threads time title tree tutorial-sample update variablebinding windows xor






