Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write the Java interface for the class CollegeStudent LISTING C-3 The class Co1legeStudent 1 2 3 4 5 6 7 8 9 10 11 12
Write the Java interface for the class CollegeStudent
LISTING C-3 The class Co1legeStudent1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 LISTING C-3 The class public class Col legeStudent extends Student // Year of graduation private int year; // Degree sought private String degree; public CollegeStudent() super() ; year = O; // Must be first statement in constructor degree = // end default constructor public CollegeStudent(Name studentName, String student ld, int graduationYear, String degreeSought) // Must be first super (studentName, student ld) ; = graduationYear; year degree = degreeSought; } // end constructor public void setStudent(Name studentName, String student ld, int graduationYear, String degreeSought) // NOT fullName - setName(studentName) ; - studentName; // NOT id = setld(studentld) ; student ld; Or setStudent(studentName, studentld) ; (see Segment C. 16) = graduationYear; year degree = degreeSought; } // end setStudent public String toString() return super.toString() + } // end toString // end CollegeStudent + degree + + year;
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started