DTCC interview question

OOP in java