class MyClass {
}
class Widget extends MyClass {
staticprivateint widgetCount = 0;
staticsynchronizedint addWidget() {
widgetCount++;
return widgetCount;
}
int anotherMethod() {
return widgetCount;
}
}
A. methods in the Widget class can access it.
B. only the addWidget method can access it.
C. If another class tries to access widgetCount, a runtime exception will be thrown.
D. only methods in the Widget class and any derived classes can access it.