| | |
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 |
actuate add android api applet application applications array arrays automation balls bank binary bluetooth business chat class clear client code codesnippet collections component database defaultmethod development dice digit dragging ebook eclipse equation error event formatingtextintooltipjava fractal functiontesting game givemetehcodez graphics gui health hql html hyper ide idea image infinite int integer invokingapacheantprogrammatically j2me java javame javaprojects jni jpanel julia linux list main map method methods mobile myregfun mysql netbeans nonstatic openjavafx parameter pearl php problem program project recursion repositories scanner scrollbar server set sms sort sorting spamblocker sql sqlserver state storm string sun superclass swing swt thread threads tree windows






