String in java

String is a group of character or sequence of data. But in java String is a…