PRO192_FE_SP23_311.webp
Soram

PRO192_FE_SP23_311.webp

  • Media owner Soram
  • Ngày thêm
Bài viết gốc: Chủ đề 'PRO192 FE SP23'
Answer (Choose 1 answer)
Which statement is true about this code?
1. class A
2. {
3.private static int x = 100;
4.
5.public static void main(String args[])
6.
{
7.A t = new A();
8.tx++;
9.10.A h = new A();
h.x++;
11.h = new A();
12.h.x++;
13.A.x++;
14. System.out.println("x = " + x);
15. }
16.}
A. Line 8 will not compile because it is a static reference to a private variable.
B. Line 13 will not compile because it is a static reference to a private variable.
C. The program compiles and the output is x = 102.
D. The program compiles and the output is x = 103.
E. The program compiles and the output is x = 104.
Eut

Thông tin

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

Share this media

Back
Bên trên Bottom