In Java there is no simple way of reading the input - the programmer herself/himself must take care of possible errors etc. That is why I programmed a small class, with which the students can easily read numbers and lines.
An easy (and clumsy!) way of using the class is to copy the Java file Lue.java to the directory, where own programs are stored. Before using the class you must, of course, compile it with the command javac.
You do not need to understand this class yet, just use it...
There are three tools in the class Lue:
int number1; double number2; String line; char character; number1 = Lue.kluku(); number2 = Lue.dluku(); line = Lue.rivi(); character = Lue.merkki();Important: The empty brackets () are necessary!
There is also an English version, Read.java, of this class!