Solved Please Provide The Java Code For The Above Question

Solved Please Provide The Java Code For The Above Question