How to handle exception in Java?

How to handle Exception in thread "main" java.lang.NoSuchMethodError: main Java Result: 1?

  • I am trying to run a program in java but I keep getting this error. I am using netbeans, and I only got this error after clicking on a button to create a code stub for it (i did type in some code for the button). How can I fix this problem?

  • Answer:

    Extend your question with the code. The main reason you would get an error like that is because just like the error says, there is a non-existent method being used, so you would have to check what you put into the code of that button. Maybe you made a spelling mistake, for instance instead of calling the method "toString()" you accidentally called "toSting()". Who knows, but if you post your code (or if you want you can even email it to me) I'll be glad to take a look at it. EDIT: Unfortunately, this is a really big code and I'm trying to compile it, but it gives me a gigantic quantity of errors, specifically in the "add" methods, which seem to be used the wrong way. I advise you to do the following: 1. Go to stackoverflow.com, this website has a huge amount of advanced programmers who are willing to help out anyone. 2. (If possible) post only the part of the code where you're getting the errors. 3. Post the error itself (java.lang.NoSuchMethodError etc etc). You will most likely get an answer within 3 minutes, and since many of the people there are specifically trained in programming, they will certainly be able to help you. Good luck, and I apologize for the lack of help from my side.

Bleh22 at Yahoo! Answers Visit the source

Was this solution helpful to you?

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.