RS interview question

Java c oops