I looked at your files, now I don't understand your question!
how do I create a file with a list of all the words that can be accessed by an user input to verify if the word exists?
You already have that fileI dont know how to create or access this file through the main.
The code already has methods to read the file into memory, and check if a given word is present.I know that I have to use equals or == to compare the input
The code contains an example of exactly how to do that
Maybe you need to read that code very carefully again - it seems to contain everythung you need.
Finally, when you have code to post, include it in your message and enclose it on CODE tags (highlight all the code and click the CODE format item above the message edit area). That way people can see the code easily, and with comments, constants etc colour-coded.
JamesCherrill
Posting Genius
6,373 posts since Apr 2008
Reputation Points: 2,130
Solved Threads: 1,073
@JamesCherrill agree on code in post and I move it there ;)
peter_budo
Code tags enforcer
15,436 posts since Dec 2004
Reputation Points: 2,806
Solved Threads: 902
Just start writing a simple method eg
public static boolean isValidChange(String word1, String word2) { ...
You have 3 cases to test for - change, add, remove a letter. Code and test those 1 at a time. Start with 1 letter changed, that's probably the easiest.
JamesCherrill
Posting Genius
6,373 posts since Apr 2008
Reputation Points: 2,130
Solved Threads: 1,073
Loop thru both words simultaneously (compare word1char1 with word2char1 etc) counting how many times the corresponding chars are the same - total should be length-1
JamesCherrill
Posting Genius
6,373 posts since Apr 2008
Reputation Points: 2,130
Solved Threads: 1,073