Java Code for Advanced Programming