-
Notifications
You must be signed in to change notification settings - Fork 2
Update Student.java #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
titush6002
wants to merge
10
commits into
main
Choose a base branch
from
titush6002-patch-1
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
4a53d44
Update Student.java
titush6002 02dc106
Create Stud.java
titush6002 1508677
Update Student.java
titush6002 74290c5
Delete Stud.java
titush6002 ef84405
Create Stud.java
titush6002 6ff1976
Create Teach.java
titush6002 d6c0672
Update Stud.java
titush6002 f82ad25
Update RunMe.java
titush6002 161b7b5
Rename Stud.java to McdWork.java
titush6002 10ee716
Update RunMe.java
titush6002 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| // Think of package as a directory, we can import packages for reuse | ||
| package org.gh; | ||
|
|
||
| // 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{ | ||
|
|
||
| // attribute to store students grade | ||
| // NOTE: it's private, so we provide a getter and setter | ||
| private String pay; | ||
|
|
||
| // set grade | ||
| public void setPay(String pay){ | ||
| this.pay = pay; | ||
| } | ||
| // get grade | ||
| public String getPay(){ | ||
| return this.pay; | ||
| } | ||
|
|
||
| // constructor called to create a new student object | ||
| // See it's usage in RunMe | ||
| public McdWork(String name, String grade){ | ||
| super(name); | ||
| this.setPay(pay); | ||
| } | ||
|
|
||
| // Because this class implements Printable, I must override the printMe() method | ||
| public String printMe(){ | ||
| // For a student, I want the name and grade to print | ||
| return "McdWork details from PrintMe() - " + this.getName()+ " - "+this.getPay(); | ||
| } | ||
| } | ||
| //1 |
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| // Think of package as a directory, we can import packages for reuse | ||
| package org.gh; | ||
|
|
||
| // extends Parent means we inherit from Parent | ||
| // This gives Teacher the ability to use Parent methods and attributes | ||
| // implements Printable means we must override the methods in that interface | ||
| public class Teach extends Person implements Printable{ | ||
|
|
||
| // attribute to store teacher's class | ||
| private String classes; | ||
|
|
||
| // Constructor of tacher taking a name and class as input | ||
| public Teach(String name, String classes){ | ||
| // Call superclass constructor (in this case Person) | ||
| super (name); | ||
|
|
||
| // Set the class for this teacher | ||
| this.setClasses(classes); | ||
| } | ||
|
|
||
| // get Class | ||
| public String getClasses(){ | ||
| return this.classes; | ||
| } | ||
|
|
||
| // Set class | ||
| public void setClasses(String classes){ | ||
| this.classes = classes; | ||
| } | ||
|
|
||
| // Because this class implements Printable, I must override the printMe() method | ||
| public String printMe(){ | ||
| return "Teacher details from printMe() = " + this.getName()+ " - "+this.getClasses(); | ||
| } | ||
| } |
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.
There was a problem hiding this comment.
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"