EY interview question

1. String related Java program.