Which solution correctly implements this goal?

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?

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?

A.
Declare a local variable invokeCount inside the go() method, and increment the variable within
the go() method.

B.
Declare a static variable invokeCount for the class Foo, and increment the variable within the
go() method.

C.
Declare a method parameter invokeCount as the argument to the go() method, and increment
the variable within the go() method.

D.
Declare an instance variable invokeCount for the class Foo, and increment the variable within
the go() method.



Leave a Reply 0

Your email address will not be published. Required fields are marked *