Homework related to basic syntax in Java