java coursework - part A