Agilysys interview question

Java, write a code for string