XYZ (Turkey) interview question

Java technical