Reputation: 11
I'm new to Java and use Eclipse.
When using the debugger's
step into
button, it will sometimes open up a new class with loads of code and comments. It will then start stepping through a few lines of the new class it opened and then jump back to my class.
Sometimes it opens up more than one class and takes 20 steps to jump back to my code.
Can someone give me a simplified explanation why this happens and what the new class it opened is for?
Upvotes: 1
Views: 810
Reputation: 13607
Quoting from the article
Step into – An action to take in the debugger. If the line does not contain a function it behaves the same as “step over” but if it does the debugger will enter the called function and continue line-by-line debugging there.
Step over – An action to take in the debugger that will step over a given line. If the line contains a function the function will be executed and the result returned without debugging each line.
So what is happening in your case is debugger is going through function's implementation from the framework or library that you used, which is invoked in your code.
As mentioned in the comments used step over instead of step into, so the debugger will not go through those framework or library source code.
Upvotes: 1