Sorry this is a simple question and I can’t find what I’m looking for probably because I don’t know what the keywords are.
For example I have a read.java that should be able to read how many A’s there in a file called quotes.txt when I redirect the file:
read < quotes.txt
How do I read from quotes.txt in java?
You can use
new Scanner(System.in). It will be available as Standard Input Stream forread, represented bySystem.in, which is aInputStream.You can also do
and use that
br.