Input by using Scanner Class
The Scanner Class is defined within a Java Package(java.util.*; OR Java.util.Scanner).There are more methods in class Scanner .
Creating Scanner Object
Scanner Class is available in system package java.util . You must import this package to avail the facilities contained in Scanner Class.
The sequence of character contained in the string buffer is replaced by the reverse method(reverse()).String Buffer class is a mutable class means can be changed dynamically.