Please Help
Started a new module for the course I'm taking, this is the first one since I started that I've really struggled with and can't seem to find the solution. I know the code is a bit of a mess but if anyone could tell me what's wrong I'd really appreciate it.


10 Replies
⌛ This post has been reserved for your question.
Hey @Kamizama! Please useTIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here./closeor theClose Postbutton above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically marked as dormant after 300 minutes of inactivity.
I think it's because it says it returns a String but there's no return value?
The side that returns a double below also needs a return clause.
Thank you, I thought that could be it as well however it is still not running, would you be so kind to guide me on this matter if it's not too much to ask.
If you are finished with your post, please close it.
If you are not, please ignore this message.
Note that you will not be able to send further messages here after this post have been closed but you will be able to create new posts.
These are the errors I get


So, looking at the first photo, the Sandwich constructor doesn’t have an overload that takes no parameters
it’s only got public Sandwich(String mainIngredient, String bread, double price). But the first error shows that someone tried to call Sandwich() with no arguments, which is obviously the problem.
Basically, once you define a constructor that takes parameters, Java stops giving you a no-arg constructor by default.
So if you want to be able to create a Sandwich without passing anything in, you’ve got to write that empty constructor yourself, no way around it.
Got you, thank you so much you're a life saver
If you are finished with your post, please close it.
If you are not, please ignore this message.
Note that you will not be able to send further messages here after this post have been closed but you will be able to create new posts.
That did the trick, really appreciated
Post Closed
This post has been closed by <@488806021247008800>.