Oracle
1Z0-850 · Question #54
1Z0-850 Question #54: Real Exam Question with Answer & Explanation
Sign in or unlock 1Z0-850 to reveal the answer and full explanation for question #54. The question stem and answer options stay visible for context.
Question
You need to create a class Foo that will record the number of times the go() method is invoked on a particular instance of the class. Which solution correctly implements this goal?
Options
- ADeclare a local variable invokeCount inside the go() method, and increment the variable within the go() method.
- BDeclare an instance variable invokeCount for the class Foo, and increment the variable within the go() method.
- CDeclare a static variable invokeCount for the class Foo, and increment the variable within the go() method.
- DDeclare a method parameter invokeCount as the argument to the go() method, and increment the variable within the go() method.
Unlock 1Z0-850 to see the answer
You've previewed enough free 1Z0-850 questions. Unlock 1Z0-850 for full answers, explanations, the timed quiz mode, progress tracking, and the master PDF. Question stem and options stay visible so you can still see what's on the exam.