So let's look at your file input
BufferedReader br = new BufferedReader (new FileReader ("plus.txt"));
You create a BufferedReader object, that takes in a Reader of some type.
This time you've decided to use a FileReader in order to get the information inside of plus.txt
Well with Keyboard input you can do basically the exact same thing.
Instead of using a FileReader, however, you want to use what is called an InputStreamReader.
This is used to get the input stream device and put it into the bufferedreader.
An example I quickly coded up is shown below, including weak exception handling.
import java.io.*;
public class test
{
public static void main (String args[])
{
try
{
BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
System.out.print("Input Some String: ");
String line = stdin.readLine();
System.out.println("You typed: " + line);
stdin.close();
}
catch (IOException io)
{
System.err.println("IO Exception Caught");
io.printStackTrace();
}
}
}
Greetings
Albert