Maventic interview question

Java -oop Give me a coding to solve instant