Error related to arguments in a method
so i'm getting this error
java compiler: method readMessages in class Main cannot be applied to given types; required: no arguments found: java.lang.String,Message[] reason: actual and formal argument lists differ in length
but i my readMessages method doesn't require any arguments14 Replies
⌛
This post has been reserved for your question.
Hey @akuma! Please useTIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here./close
or theClose Post
button 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.
also that error is when codegrade runs it, if i run the code myself, it runs fine
What can be the issue?
Thank you in advance to anyone who decides to help
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.
For now I'm gonna go to bed since it's midnight here almost so I won't be able to respond to texts immediately
Can you show the relevant code?
💤
Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived.
If your question was not answered yet, feel free to re-open this post or create a new one.
In case your post is not getting any attention, you can try to use /help ping
.
Warning: abusing this will result in moderative actions taken against you.
uh
hold on i'll send the methods
and i am aware that here's probably more optimized ways i can write the code but i'm very new to java
so i'm not that good
Can you try compiling that with from the command-line?
Did you actually save the file?
yes, it is running smoothly on my own computer, but when codegrade runs it, it gives me the error i got above
not sure how to do that, sorry
I guess the specification requires the method to look like that?
Did you maybe get a project template or similar?
we only got basic instructions on which classes to create, what each class is supposed to have
and one by one i fixed all the errors that popped up in codegrade
then i landed on that one
if you want, i can also send a screenshot of the instructions given to us
Well I guess these instructions said what the methods should look like
yeah
and apparently the readMessages method is supposed to have no arguments
in the end i just submitted as it is since i racked my brain the whole day and couldn't figure out the issue
💤
Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived.
If your question was not answered yet, feel free to re-open this post or create a new one.
In case your post is not getting any attention, you can try to use /help ping
.
Warning: abusing this will result in moderative actions taken against you.