In-class exercise: Methods
February 23, 2011
The purpose of this exercise is to give you some practice in writing methods in classes. Given the code in StudentMain.java (see below), write a class Student that has the necessary instance variables and methods for the code in StudentMain to run. Start off by first writing the UML diagram for the Student class (should look similar to notes from Monday). Then translate the UML diagram into code.
This exercise will not be graded. We will discuss it later. You are welcome to work in groups, but make sure you understand the concepts. Ask questions if you are having trouble.
public class StudentMain
public static void main(String args)
Student s1 = new Student();
Student s2 = new Student();