Skip to content

Update Student.java#1

Open
titush6002 wants to merge 10 commits intomainfrom
titush6002-patch-1
Open

Update Student.java#1
titush6002 wants to merge 10 commits intomainfrom
titush6002-patch-1

Conversation

@titush6002
Copy link
Copy Markdown
Collaborator

No description provided.

// extends Parent means we inherit from Parent
// This gives Student the ability to use Parent methods and attributes
// implements Printable means we must override the methods in that interface
public class McdWork extends Person implements Printable{
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The class name (McdWork) must match the File Name (Stud.java). Since they don't match it's an error

Student objStudent = new Student("Student 1", "GradeA");
Teacher objTeacher = new Teacher("Teacher 1", "Class#1, Class#2");

McdWork objMcdWork = new McdWork ("Worker 1"), "Position, Salary");
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On this line, the parameters should be new McdWork("NAME", "GRADE"); (See the constructor in McdWork.java

But you've got an extra parameter (position and salary), and you don't have a Grade.

Also, you have an extra ")" before the comma after "Worker 1"

@@ -12,28 +12,34 @@ public static void main(String args[]){
System.out.println("Creating a new student and Teacher");
Student objStudent = new Student("Student 1", "GradeA");
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you rename "Student" to Stud, you'll need to update this (Same with next line for "Teacher" vs "Teach"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants