Skip to content
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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

ARajan1084
Copy link
Contributor

Achintya Rajan

Animals
Chapter 15
Section 15.1

public class Zebra extends Animal {
// TODO: Fields

public Zebra (String species, int age, String gender, String sound, int numStripes) {

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{

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) {

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{

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) {

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) {

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() {

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.

Copy link
Contributor

@JJ27 JJ27 left a 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.

@phrdang phrdang requested review from AlveeraMunshi and removed request for neha-peddinti July 1, 2021 20:21
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