FileDocCategorySizeDatePackage
Person.javaAPI DocExample769Sat Jan 13 18:10:02 GMT 2001None

Person

public class Person extends Object
A simple class used to demonstrate unit testing.

Fields Summary
protected String
fullName
protected String
firstName
protected String
lastName
Constructors Summary
public Person(String firstName, String lastName)
Construct a Person using his/her first+last names.

		this.firstName = firstName;
		this.lastName = lastName;
	
Methods Summary
public java.lang.StringgetFullName()
Get the person's full name

		if (fullName != null)
			return fullName;
		return firstName + " " + lastName;
	
public static voidmain(java.lang.String[] argv)
Simple test program.

		Person p = new Person("Ian", "Darwin");
		String f = p.getFullName();
		if (!f.equals("Ian Darwin"))
			throw new IllegalStateException("Name concatenation broken");
		System.out.println("Fullname " + f + " looks good");