PRO192_-_SP_2025_-_Block_5_-_1_3854.webp
M

PRO192_-_SP_2025_-_Block_5_-_1_3854.webp

What is the output of the following Java program?
abstract class A {
private String my_name = null;
public String myName(){
my_name = "test";
return my_name;
}
abstract void display();
}
public class Main extends A {
void display (){
String n = myName();
System.out println(n);
public static void main(String args[]) {
A obj = new Main();
obj.display();
}
}
A. test
B. Runtime error
C. null
D. None of the others

Thông tin

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

Share this media

Back
Bên trên Bottom