Professional Documents
Culture Documents
int k = MyClass.calculate(5,10);
System.out.println(k);
}
}
What is the result?
70
52
Compilation error
An exception is thrown at runtime
Topic: Access Modifiers
Given the following,
1. package testpkg.p1;
2. public class ParentUtil {
3.
4.
5. }
1. package testpkg.p2;
2. import testpkg.p1.ParentUtil;
3. public class ChildUtil extends ParentUtil {
4.
5.
new ChildUtil().callStuff();
6.
7.
void callStuff() {
8.
9.
10.
11.
12. }