Q14.webp
G

Q14.webp

Kizspy | Question: 14
(Choose 1 answer)
What will be the output of the following code snippet?
class A {
public void methodA() {
System.out.println("Class A");
class B extends A {
public void methodA() {
}
System.out.println("Class B");
public void methodB() {
System.out.println("Class B - methodB");
public class Test {
public static void main(String[] args) {
A obj = new B();
obj.methodA();
A. Class A
B. Class B
C. Compilation error due to the obj.methodB() line
D. Runtime error

Thông tin

Category
PRO192
Thêm bởi
good_luck
Ngày thêm
Lượt xem
1,745
Lượt bình luận
8
Rating
0.00 star(s) 0 đánh giá

Share this media

Back
Bên trên Bottom