String is a special class in Java and substring() method of String class is one of the widely used methods of String class. It is used to extract part of a string and has two overloaded variants: ...