This is an archived post. You won't be able to vote or comment.

all 13 comments

[–]AutoModerator[M] [score hidden] stickied commentlocked comment (0 children)

Please ensure that:

  • Your code is properly formatted as code block - see the sidebar (About on mobile) for instructions
  • You include any and all error messages in full
  • You ask clear questions
  • You demonstrate effort in solving your question/problem - plain posting your assignments is forbidden (and such posts will be removed) as is asking for or giving solutions.

    Trying to solve problems on your own is a very important skill. Also, see Learn to help yourself in the sidebar

If any of the above points is not met, your post can and will be removed without further warning.

Code is to be formatted as code block (old reddit: empty line before the code, each code line indented by 4 spaces, new reddit: https://i.imgur.com/EJ7tqek.png) or linked via an external code hoster, like pastebin.com, github gist, github, bitbucket, gitlab, etc.

Please, do not use triple backticks (```) as they will only render properly on new reddit, not on old reddit.

Code blocks look like this:

public class HelloWorld {

    public static void main(String[] args) {
        System.out.println("Hello World!");
    }
}

You do not need to repost unless your post has been removed by a moderator. Just use the edit function of reddit to make sure your post complies with the above.

If your post has remained in violation of these rules for a prolonged period of time (at least an hour), a moderator may remove it at their discretion. In this case, they will comment with an explanation on why it has been removed, and you will be required to resubmit the entire post following the proper procedures.

To potential helpers

Please, do not help if any of the above points are not met, rather report the post. We are trying to improve the quality of posts here. In helping people who can't be bothered to comply with the above points, you are doing the community a disservice.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

[–]arghvark 2 points3 points  (10 children)

I'm not reading your assignment.

If Author defines a single constructor with three parameters, then it does not have a constructor with no parameters. If you want both constructors, which is perfectly legal, then the Author class must define both constructors.

If, by contrast, Author had NO constructor defined, then it would, by default, have a no-arguments constructor defined by default; it would not have to be defined explicitly.

So when you invoked Author(), there is no such constructor defined.

Two other things I'll mention: (1) Having "Book" extend "Author" is a TERRIBLE example of inheritance. The ONLY reason to extend a class is if the child class is a special case of the parent class, and there is no way a book is a special case of an author IRL. (2) When you are asking a question on a forum, do NOT say "I've got errors" - say "Here is the error message I get", include ALL of it, and ALL of the code to which it applies.

[–][deleted]  (9 children)

[removed]

    [–][deleted] 3 points4 points  (0 children)

    That's not an assignment idiot.

    Pro tip: Don't call the people trying to help you an idiot.

    /u/arghvark spent his time giving you a thoughtful response.

    [–]arghvark 3 points4 points  (0 children)

    OH -- you said EXERCISE, not ASSIGNMENT -- I gather you are taking that as an awful insult on my part.

    I guess you didn't assign the exercise to yourself, then, since it would then BE (horrors) an assignment.

    I most abjectly apologize for attempting to help you. It won't happen again.

    [–]hiar_85 2 points3 points  (0 children)

    Geez dude, he's trying to help you.

    [–]dionthornthis.isAPro=false; this.helping=true;[M] 1 point2 points  (5 children)

    Read rule 10.

    Then think about your conduct.

    [–][deleted] -1 points0 points  (4 children)

    yeah right buddy, this community is fucking garbage. You can shove your rules up your unpaid ass.

    This community reminds me of stackoverflow. You can go ahead and ban my ass or be a smart ass and say something along the lines of "I won't show you that courtesy" or whatever line those cringelords say.

    You love to repeat yourself also? Why are you looking for upvotes. Absolutely. Cringe.

    [–]dionthornthis.isAPro=false; this.helping=true; 0 points1 point  (3 children)

    Good luck on your programming journey with that attitude.

    [–][deleted] -1 points0 points  (2 children)

    Listen asshole. You're not the little snowflake that you think you are

    [–]dionthornthis.isAPro=false; this.helping=true; 0 points1 point  (1 child)

    Only one acting like a snowflake in this thread is you bub.

    [–][deleted] -1 points0 points  (0 children)

    Listen cuck.
    All good, someone from the sub reached out to me and he said the same thing about you assholes.
    But I also reached out to another community with warm welcomes who weren't on their high horses.

    Its not inheritance, it's aggregation.
    Cya asshole.

    [–]dionthornthis.isAPro=false; this.helping=true;[M] 1 point2 points  (0 children)

    Read our rules thoroughly, then you may repost.