here is the methods are static now.
What will it print now? class Base{
static int value = 0;
Base(){
addValue();
}
static void addValue(){
value += 10;
}
int getValue(){
return value;
}
}
class Derived extends Base{
Derived(){
addValue();
}
static void addValue(){
value += 20;
}
}
public class
Test {
public static void main(
String[] args){
Base b = new Derived();
System.out.println(b.getValue());
}
}
answer is 30..plz anyone explain me how