This set of Advanced Java Multiple Choice Questions & Answers (MCQs) focuses on “Debugging in Eclipse”.
1. Which mode allows us to run program interactively while watching source code and variables during execution?
a) safe mode
b) debug mode
c) successfully run mode
d) exception mode
Explanation: Debug mode allows us to run program interactively while watching source code and variables during execution.
2. How can we move from one desired step to another step?
Explanation: Breakpoints are inserted in code. We can move from one point to another in the execution of a program.
3. Which part stores the program arguments and startup parameters?
a) debug configuration
b) run configuration
c) launch configuration
d) project configuration
Explanation: Launch configuration stores the startup class, program arguments and vm arguments.
4. How to deep dive into the execution of a method from a method call?
Explanation: 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.
5. Which key helps to step out of the caller of currently executed method?
Explanation: 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.
6. Which view allows us to delete and deactivate breakpoints and watchpoints?
a) breakpoint view
b) variable view
c) debug view
d) logger view
Explanation: The Breakpoints view allows us to delete and deactivate breakpoints and watchpoints. We can also modify their properties.
7. What is debugging an application which runs on another java virtual machine on another machine?
a) virtual debugging
b) remote debugging
c) machine debugging
d) compiling debugging
Explanation: 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.
8. What happens when the value of variable change?
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
Explanation: When a variable value changes, the value in variable tab is highlighted yellow in eclipse.
9. Which perspective is used to run a program in debug view?
a) java perspective
b) eclipse perspective
c) debug perspective
d) jdbc perspective
Explanation: We can switch from one perspective to another. Debug perspective shows us the breakpoints, variables, etc.
10. How does eclipse provide the capability for debugging browser actions?
a) internal web browser
b) chrome web browser
c) firefox web browser
d) internet explorer browser
Explanation: Eclipse provides internal web browser to debug browser actions.
Sanfoundry Global Education & Learning Series – Java Programming Language.
To practice all areas of Java language, here is complete set of 1000+ Multiple Choice Questions and Answers.