I made a method but cant run it

No description
12 Replies
JavaBot
JavaBot6mo ago
This post has been reserved for your question.
Hey @Juan! Please use /close or the Close 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.
TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.
reiwa
reiwa6mo ago
@Juan Java runs the method called public static void main(String[] args) when you run your program, so you need to call your take() method from in there, otherwise it won't be called. however, right now you have your take method set up to take a String[] called args as input which you are then not using, so you should remove that. I suspect you just copied it from the main method, which I understand, but it's not needed and will throw an error if you try to run it. your code has other problems as well but at least doing that will allow your code to run. once you get it working I can suggest some ways for you to improve you code that you can then try working on if you want?
JavaBot
JavaBot6mo ago
💤 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.
ayylmao123xdd
ayylmao123xdd6mo ago
he has a main method just needs to use it to call the take method
Hype_the_Time (PING ON REPLY)
has to be called main i believe. essentially intelij does not see it as you wanting to run it. for intelij it probably looks like a normal method that takes arguments. make it so you call it from move original main somewhere else or sth. alternatively make a new class and put it there. that way you dont have the duplicate method name error welp didnt see below messages but post wasnt closed ig
Michel
Michel6mo ago
You made a method but it dont run the method To call the method add to line 13: take(args);
JavaBot
JavaBot6mo ago
💤 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.
Juan
JuanOP6mo ago
I did manage to run the code, now is working well. Thanks for the advises
JavaBot
JavaBot6mo ago
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.
reiwa
reiwa6mo ago
you're welcome! glad you got it fixed
Juan
JuanOP6mo ago
I manage to get it right, thanks bro thanks for the help bud After some try and error I got it right, you helped a lot.
JavaBot
JavaBot6mo ago
Post Closed
This post has been closed by <@1383227897346658324>.

Did you find this page helpful?