Maventic Interview Question

Java -oop Give me a coding to solve instant