Answer:
Option(c) is the correct answer for the given question.
Explanation:
The method variable overrides the class variable name with same name The method variable overrides of the class variable name .
Following are the example in java language
public class Main
{
int b=90; // class varaible or instance varaible
void sum()
{
int b=34; // method having same name as class varaible name
b=b+10;
System.out.println(b); // display b
}
public static void main(String[] args) // main method
{
Main ob=new Main(); // craete object
ob.sum(); // calling method sum
}
}
Output:
44
In this we declared a variable 'b' as int type in class and override this variable in sum() function it means same variable name is declared in function sum() .
acquiesces ,destroys,alters are the wrong for the given question.
So overrides is the correct answer
Answer:
See explaination
Explanation:
class Counter:
def getValue(self):
return self._value
def undo(self):
if self._value > 0:
self._value = self._value - 1;
def click(self):
self._value= self._value + 1
def reset(self):
self._value= 0
tally= Counter()
tally.reset()
tally.click()
tally.click()
result = tally.getValue()
print("Value:", result)
tally.click()
result = tally.getValue()
print("Value:", result)
tally.undo()
tally.undo()
result = tally.getValue()
print("Value:", result)
tally.undo()
tally.undo()
result = tally.getValue()
print("Value:", result)
The answer to this question is <span>(B4/B8)*10</span>
Cyberphobia is a fear of computers