The Scanner
class is used to read user input in a Java program. It requires declaration within a program before a user of the program is prompted to input values.
IOException
s refer to any errors that a program may encounter that are related to the input or output of a Java program.
Java programs must first be compiled into bytes, and only then can they be run using the terminal or command prompt.
In Java, FileInputStream
is used to read data from a file into the program.
In Java, FileOutputStream
is used to output data from a program into a file on your computer.
In order to print output using a Java program, a developer can use the following three commands:
System.out.print()
: prints in the same line a when a program is runningSystem.out.println()
: prints output in a new lineSystem.out.printf()
: prints formatted string. It allows for the use of format specifiers such as “%s” or “%c” that can be used to insert variable values