-
-
Notifications
You must be signed in to change notification settings - Fork 5
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
med difficulty practice problem for abstract classes Ch 15 #17
base: master
Are you sure you want to change the base?
Conversation
public class Zebra extends Animal { | ||
// TODO: Fields | ||
|
||
public Zebra (String species, int age, String gender, String sound, int numStripes) { |
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.
[reviewdog] reported by reviewdog 🐶
'(' is preceded with whitespace.
@@ -0,0 +1,13 @@ | |||
package com.codefortomorrow.advanced.chapter15.practice.animals; | |||
|
|||
public class Cat extends Animal{ |
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.
[reviewdog] reported by reviewdog 🐶
WhitespaceAround: '{' is not preceded with whitespace.
public class Cat extends Animal{ | ||
// TODO: Fields | ||
|
||
public Cat (String species, int age, String gender, String sound, String color) { |
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.
[reviewdog] reported by reviewdog 🐶
'(' is preceded with whitespace.
@@ -0,0 +1,13 @@ | |||
package com.codefortomorrow.advanced.chapter15.practice.animals; | |||
|
|||
public class Dog extends Animal{ |
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.
[reviewdog] reported by reviewdog 🐶
WhitespaceAround: '{' is not preceded with whitespace.
public class Dog extends Animal{ | ||
// TODO: Fields | ||
|
||
public Dog (String species, int age, String gender, String sound, int ageDogYears) { |
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.
[reviewdog] reported by reviewdog 🐶
'(' is preceded with whitespace.
private String gender; | ||
private String sound; | ||
|
||
public Animal(String species, int age, String gender, String sound) { |
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.
[reviewdog] reported by reviewdog 🐶
Missing a Javadoc comment.
this.ageInDogYears = ageInDogYears; | ||
} | ||
|
||
public void makeSound() { |
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.
[reviewdog] reported by reviewdog 🐶
Missing a Javadoc comment.
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.
Looks good! One thing, why is each animal's sound passed into the constructor when creating an instance of a Cat, Dog, etc? Isn't a Dog always going to say something like "Woof" and a Cat something like "Meow"?. Maybe for Zebra you can still have it pass in. That's just my thought but you can keep it as is if that was the intention.
Achintya Rajan
Animals
Chapter 15
Section 15.1