Campbell Ritchie wrote:Welcome to the Ranch
Start by moving all that code out of the main() method. It is not intended for writing business logic (nor games logic). That code all belongs in different methods, probably in different classes. Also, such a long method is a maintenance nightmare.
Don't use the == operator on Strings. Your test in line 101 is guaranteed to go wrong.
Trystin Garcia wrote:am having trouble understanding the use of more than 1 method. Is it neatness or is there an actual reason.
Not Equals but equals please, but call it a method, not a function. People will understand you better if you use the correct jargon.
Trystin Garcia wrote:. . .I have to rewrite the =='s using the Equals function, . . .
Yes it does, but you aren't presenting it with yes or no. Have you changed your code? If so, please show us it. Did you understand what I linked to about nextLine() in my earlier post?
it doesn't allow me to answer the yes or no question.
So you haven't solved that problem. Have you looked at the links I gave you?
Trystin Garcia wrote:. . . While the Change Case finishes then doesnt let you type N, and just ends the code
Trystin Garcia wrote:
Please tell us what you don't understand and we shall try to explain it, just as Bob Winter is already trying to help you.
Trystin Garcia wrote:. . . hard to understand
Bob Winter wrote:. . . got from int to a line? . . .
Have you tried that? Make sure to wrap it in quotes to make it easier to read: System.out.printf("Continuation = \u201c%s\u201d%n", continuation);
How about printing continuation to see whats in it?
Junilu Lacar wrote:Compare how much easier this would be to read and comprehend vs. the giant block of code that you have written:
Then you'd have smaller methods for doView(), doSearch(), etc., with each subtask being done in its own special "room" in your program.
How would I give the all 4 methods the arrays to use.
I did what you said.
So this is my second test file, how would I pass the info of the array to all 4 of them
Time flies like an arrow. Fruit flies like a banana. Steve flies like a tiny ad:
ScroogeXHTML 8.7 - RTF to HTML5 and XHTML converterhttps://coderanch.com/t/730700/ScroogeXHTML-RTF-HTML-XHTML-converter