Open
Conversation
meagherj
reviewed
Dec 4, 2022
| // 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{ |
Owner
There was a problem hiding this comment.
The class name (McdWork) must match the File Name (Stud.java). Since they don't match it's an error
meagherj
reviewed
Dec 4, 2022
src/org/gh/RunMe.java
Outdated
| 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"); |
Owner
There was a problem hiding this comment.
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"
meagherj
reviewed
Dec 4, 2022
| @@ -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"); | |||
Owner
There was a problem hiding this comment.
If you rename "Student" to Stud, you'll need to update this (Same with next line for "Teacher" vs "Teach"
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.