140k views
5 votes
Any concrete subclass that extends class Foo ________. must implement a method called calculate will not be able to access the instance variable a Neither must implement a method called calculate nor will not be able to access the instance variable a. Both must implement a method called calculate and will not be able to access the instance variable a.

User GeorgeB
by
5.5k points

1 Answer

4 votes

Answer:

both must implement a method called calculate and will not be able to access the instance variable.

Step-by-step explanation:

Based on the information provided within the question it can be said that any concrete subclass that extends class Foo both must implement a method called calculate and will not be able to access the instance variable. As shown in the code above the method inside the Foo subclass needs to exist outside of it in order for it to be called, and since the a variable is an instance variable (meaning it is only accessible by code inside the function) it cannot be used by extending classes.

User Ivan G
by
6.3k points