Page 332 - Introduction to Programming with Java: A Problem Solving Approach
P. 332
298 Chapter 8 Software Engineering
/*********************************************************************
*
Student.java
Dean & Dean
This class handles processing of a student's name.
*********************************************************************/
*
*
*
import java.util.Scanner;
public class Student
{
private String first = ""; // student's first name
private String last = ""; // student's last name
//******************************************************************
public Student()
{}
// This constructor verifies that each passed-in name starts
// with an uppercase letter and follows with lowercase letters.
public Student(String first, String last)
{
Apago PDF Enhancer
}
setFirst(first);
setLast(last);
//******************************************************************
Figure 8.2a Student class—part A
Method Descriptions
Note the descriptions above one of the constructors in Figure 8.2a and the methods in Figure 8.2b. Put things in this order above each method:
• blank line
• lineofasterisks • blank line
• description
• blank line
For short obvious methods, it’s OK to omit the method description. Between short constructors and between short accessor and mutator methods, it’s also OK to omit the line of asterisks.