create oop example#3
Open
KYehor wants to merge 1 commit into
Open
Conversation
| } | ||
|
|
||
| @Override | ||
| public Value getValue() { |
|
|
||
| public class CountingProfessor implements Accounting<Professor,Value> { | ||
|
|
||
| private String salary; |
|
|
||
| public class CountingStudent implements Accounting<Student,Value> { | ||
| private String salary; | ||
| private int sal = 800; |
| @Override | ||
| public void printData() { | ||
| System.out.println("I'm an extramural student: " + this.getName()); | ||
| } |
There was a problem hiding this comment.
there is toString for this
| public class CountingProfessor implements Accounting<Professor,Value> { | ||
|
|
||
| private String salary; | ||
| private int sal = 500; |
|
|
||
| public CountingProfessor(){ | ||
| } | ||
|
|
Contributor
There was a problem hiding this comment.
@KYehor, don`t create an empty constructor if you never use it
| package com.company; | ||
|
|
||
| public class ExtramuralStudent extends Student { | ||
|
|
| @@ -0,0 +1,14 @@ | |||
| package com.company; | |||
|
|
|||
| public class Faculty extends University{ | |||
Contributor
There was a problem hiding this comment.
@KYehor, Faculty is not University, University has a Faculty
| public class ExtramuralStudent extends Student { | ||
|
|
||
| public static void printAboutStudent(){ | ||
| System.out.println("Hello,i'm an extramural student."); |
Contributor
There was a problem hiding this comment.
@KYehor, check java general convention regarding methods ordering in class
| countingStudent = new CountingStudent(); | ||
| } | ||
|
|
||
| public void getSal(Student student,int sal){ |
| @@ -0,0 +1,10 @@ | |||
| package com.company; | |||
|
|
|||
| public class StudentRecordBook { | |||
| public class Professor extends UniversityPerson { | ||
|
|
||
| public Professor(){ | ||
| numbOfUP++; |
Author
There was a problem hiding this comment.
what is it ?
Just for calculate numbers of university persons.
Owner
|
Please, make one commit for this PR |
87b9059 to
04595b7
Compare
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.