Student - { public String city; public String state; public

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
/** * The Student class <class * for input of name, major, * city and state of a student> * @author Jeff Cox */ * public class Student { String stuName; StudentAddress stuAddress; String major; static int stuCount; public Student(String newName, String newCity, String newState, String newMajor) { stuName = newName; major = newMajor; stuAddress = new StudentAddress(newCity, newState); stuCount++; } public class StudentAddress
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: { public String city; public String state; public StudentAddress(String newCity, String newState) { city = newCity; state = newState; } } public String toString() { String str; str = &quot;Name: &quot; + stuName + &quot;\nMajor: &quot; + major + &quot;\nCity: &quot; + + &quot;\nState: &quot; + stuAddress.state; return str; } public static int stuCount() { return stuCount; } }...
View Full Document

This note was uploaded on 07/28/2009 for the course CSI 161 taught by Professor Deborahpenna during the Spring '09 term at Anne Arundel CC.

Ask a homework question - tutors are online