Caterpillar interview question

Java advanced questions with oops concept