- Array 1D and 2D
- Array is a collection of similar type of elements that have contiguous memory location.
- Java array is an object the contains elements of similar data type.It is a data structure where we store
similar
elements. We can store only fixed set of elements in a java array.
- Taking Input from User
- Java Scanner class allows the user to take input from the console. It belongs to
java.util package. It is used to read the input of primitive types like int, double,
long,
short, float, and byte. It is the easiest way to read
input in Java program.
Syntax:
Scanner sc=new Scanner(System.in);
- Java Reader Class
- Java Reader is an abstract class for reading character streams. The only methods that a subclass must
implement are
read(char[], int, int) and close(). Most subclasses, however, will override some of the methods to provide
higher
efficiency, additional functionality, or both.
- Buffer Reader Class
- Java BufferedReader class is used to read the text from a character-based input stream. It can be used
to
read data line
by line by readLine() method. It makes the performance fast. It inherits Reader class.