Efficient programs always need locating the bugs and fixing those. Basic meaning of debugging a program is to run through the code with the Interpreter. Debugging enables the user to see whether the path of execution is as per his expectations or same as the path meant for them and only through them. When a programmer says he has debugged the program, it means bugs has been worked out and bugs no longer exist.
For a Java programmer there are varieties of tools but if you are using an editor like NetBeans then it becomes quite easy for you to debug the program.