add java solution for Main