PRO192_-_FA_2024_-_RE_3069.webp
Nitta93

PRO192_-_FA_2024_-_RE_3069.webp

  • Media owner Nitta93
  • Ngày thêm
Kizspy | Question: 28 (Choose 1 answer)
class A {
What will be the output of the following Java code?
int a = 5;public int getA() {
return a;
} } //class A
class B extends A {
private int a = 6;
public void rollBackA() {
a++;
a = super.getA();
}
}//class B public class Main {
public static void main(String[] args) {
A objA= new A();
B objB = new B();
objB.rollBackA();
System.out.format("%d %d%n", objA.getA(), objB.getA());
}
}
A. 5,5
B. 6,6
C. 5,6
D. 6,5
FUOV

Thông tin

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

Share this media

Back
Bên trên Bottom