0
Hi mates..
I'm trying to find a way in how to inputing or outputting from a file in Java.
For my bad luck when I finished my Java course, our professor didn't talked about this thing.
I searched in the internet, and found a way in inputing from a file which is:
import java.io.File; import java.io.FileNotFoundException; try { Scanner input = new Scanner(new File("file.txt")); } catch (FileNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); }
but after that, how to read the content of that file! also, if the file has a paragraph how can I search for a specific words, I think in java I can only read a line not a word!
for example "a" or "if" or "playing" how can I look for them if they exist in the file or not.
After that, how to output the data I want in an output file!
Thanks in advance.