| | |
Palindromes
![]() |
•
•
Join Date: Aug 2006
Posts: 137
Reputation:
Solved Threads: 11
When I said, 'Where ... refers to the code after the line String s = inFile.readLine();' I meant all of the code. A loop will allow for a set of instructions to be executed 0, 1 or more times. If all you want to repeat is reading the data from the file, then that leaves you with only processing the last line of the file.
You need to read in the data and process it and that's what needs to be repeated and thus placed in a loop.
Anyway, what do you mean by, 'at the start of my boolean?' Please use the [code=java] so line numbers appear. That way you can tell us which line the error occurred. The expression in the while loop is not incorrect and would compile.
Regardless, by looking at your code I can see that you're missing some braces. Particularly, you don't close the for loop nor do you close the main method. This is why you're getting the error.
You need to read in the data and process it and that's what needs to be repeated and thus placed in a loop.
Anyway, what do you mean by, 'at the start of my boolean?' Please use the [code=java] so line numbers appear. That way you can tell us which line the error occurred. The expression in the while loop is not incorrect and would compile.
Regardless, by looking at your code I can see that you're missing some braces. Particularly, you don't close the for loop nor do you close the main method. This is why you're getting the error.
Last edited by PoovenM; Dec 18th, 2008 at 9:49 am.
First of all:
Next time post what kind of error you get and where you get it so we wouldn't have to search the entire code for the error.
And second:
This:
should be:
Next time post what kind of error you get and where you get it so we wouldn't have to search the entire code for the error.
And second:
This:
Java Syntax (Toggle Plain Text)
public static boolean isPalindrome(s) { }
should be:
Java Syntax (Toggle Plain Text)
public static boolean isPalindrome(String s) { }
Last edited by javaAddict; Dec 18th, 2008 at 10:02 am.
Check out my New Bike at my Public Profile at the "About Me" tab
![]() |
Similar Threads
- Help with palindromes (C++)
- Palindromes...but determining using variables (C)
- 5 digit palindromes Array (Java)
- I created another Stack that tells if word is palindrome, need help (Java)
- Stack- need help (Java)
- palindrome (Java)
- Scan text file to find all words of 4 characters or less (Shell Scripting)
- creating our own C++ strcat() function, code reqd (C++)
- palendromes with a string tokeniser (Java)
Other Threads in the Java Forum
- Previous Thread: Java Beginner Need Help!
- Next Thread: Problem with Arrays
| Thread Tools | Search this Thread |
911 actionlistener addressbook android api append applet application array arrays automation binary block bluetooth character class client code component consumer csv database desktop developmenthelp eclipse error fractal ftp game gameprogramming givemetehcodez graphics gui html ide image integer j2me j2seprojects japplet java javaarraylist javac javaee javaprojects jni jpanel julia lego linked linux list loops mac map method methods mobile netbeans newbie number objects online oriented panel printf problem program programming project projects properties recursion replaydirector reporting researchinmotion rotatetext rsa scanner se server set singleton sms sort sql string swing system test textfields threads time title tree tutorial-sample ubuntu update windows working






