StringReader Class in Java

StringReader class in Java StringReader class is a character input stream that uses a String object…