java homework code