This set of Advanced Java Multiple Choice Questions & Answers (MCQs) on “Debugging in Eclipse”.
1. Which mode allows us to run program interactively while watching source code and variables during execution? Answer: b 2. How can we move from one desired step to another step? Answer: a 3. Which part stores the program arguments and startup parameters? Answer: c 4. How to deep dive into the execution of a method from a method call? Answer: b 5. Which key helps to step out of the caller of currently executed method? Answer: c 6. Which view allows us to delete and deactivate breakpoints and watchpoints? Answer: a 7. What is debugging an application which runs on another java virtual machine on another machine? 8. What happens when the value of variable change? Answer: d 9. Which perspective is used to run a program in debug view? Answer: c 10. How does eclipse provide the capability for debugging browser actions? Answer: a
a) safe mode
b) debug mode
c) successfully run mode
d) exception mode
Clarification: Debug mode allows us to run program interactively while watching source code and variables during execution.
a) breakpoints
b) System.out.println
c) logger.log
d) logger.error
Clarification: Breakpoints are inserted in code. We can move from one point to another in the execution of a program.
a) debug configuration
b) run configuration
c) launch configuration
d) project configuration
Clarification: Launch configuration stores the startup class, program arguments and vm arguments.
a) F3
b) F5
c) F7
d) F8
Clarification: F5 executes currently selected line and goes to the next line in the program. If the selected line is a method call, debugger steps into the associated code.
a) F3
b) F5
c) F7
d) F8
Clarification: F7 steps out to the caller of the currently executed method. This finishes the execution of the current method and returns to the caller of this method.
a) breakpoint view
b) variable view
c) debug view
d) logger view
Clarification: The Breakpoints view allows us to delete and deactivate breakpoints and watchpoints. We can also modify their properties.
a) virtual debugging
b) remote debugging
c) machine debugging
d) compiling debugging
Clarification: Remote debugging allows us to debug applications which run on another Java virtual machine or even on another machine. We need to set certain flags while starting the application.
java -Xdebug -Xnoagent
-Djava.compiler=NONE
-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005.
a) changed value pop on the screen
b) variable changes are printed in logs
c) dump of variable changes are printed on the screen on end of execution
d) variable tab shows variables highlighted when values change
Clarification: When a variable value changes, the value in variable tab is highlighted yellow in eclipse.
a) java perspective
b) eclipse perspective
c) debug perspective
d) jdbc perspective
Clarification: We can switch from one perspective to another. Debug perspective shows us the breakpoints, variables, etc.
a) internal web browser
b) chrome web browser
c) firefox web browser
d) internet explorer browser
Clarification: Eclipse provides internal web browser to debug browser actions.