| | |
StringTokenizer, while loops and return statements
Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Jul 2006
Posts: 3
Reputation:
Solved Threads: 0
I have some questions on StringTokenizer.
I used it to break a string that has the format :
first into the two strings:
and then:
Where
I used two while loops as well as StringTokenizer to carry this out.
However, I am supposed to return one of the tokens (say, string1)
as a string. When I use a return statement
Help please?
If you want to see the actual code that I've done I'd prefer to PM it.
I used it to break a string that has the format :
"string1,string2,string3;string4,string5,string6" first into the two strings:
Java Syntax (Toggle Plain Text)
"string1,string2,string3" "string4,string5,string6"
Java Syntax (Toggle Plain Text)
" String a = string1" "String b = string2" "String c = string3"
Where
a = string4 in the next loop, and = string7 and so on if the loop is continued.I used two while loops as well as StringTokenizer to carry this out.
However, I am supposed to return one of the tokens (say, string1)
as a string. When I use a return statement
"return string1" the loop ends and does not process the remaining tokens (by this I mean that string1 could represent a car name, and string4's position in the string also indicates that it is another car name. When I ask for the car name, it only returns the first one instead of all, to all me to compare them.Help please?
If you want to see the actual code that I've done I'd prefer to PM it.
Last edited by unitethenations; Jul 5th, 2006 at 2:01 am.
![]() |
Similar Threads
- missing return statement (Java)
- What's the meaning of the "return" here? (C++)
- Psuedocode (C++)
- missing return statement x( (Java)
- missing return statement (Java)
- Need help writing a program (C++)
- missing return statement 106 and 123, any ideas?? (Java)
- Data Abstraction (Computer Science)
Other Threads in the Java Forum
- Previous Thread: Starting With Java
- Next Thread: What the best version and download!
Views: 1901 | Replies: 1
| Thread Tools | Search this Thread |
Tag cloud for Java
account android api apple applet application arguments array arrays automation binary bluetooth chat class classes client code columns component data database draw eclipse error event exception expand file filechooser fractal game givemetehcodez google graphics gui helpwithhomework homework html ide image inheritance input integer j2me java javaprojects jlabel jme jmf jni jpanel jtextfield julia linux list loop map method methods midlethttpconnection mobile monitoring netbeans newbie nullpointerexception number object open-source oracle print problem program programming project property recursion ria scanner screen search server set size sms socket sort sourcelabs splash sql sqlite static string swing test testautomation threads time transfer tree windows






