Nguyên lý ngôn ngữ lập trình 小テスト3カンペ
1
The declaration of class A is correct but B is wrong
2
f2
fun3
f3
fun2
3
Statement //a is correct but statement //b is wrong
4
(2) – D
(1) – C
(3) – B
5
b = (B) c;
a = (A) c;
6
b, c
7
76
8
a = new B()
c = new D()
9
print(x + y) will give the result 8
print(y * x) will give the result 15
10
a (if b is referred to a B object)
c (if b is referred to a C object}