PRO192_-_C2_-_FE_-_SU_2023_398.webp
T

PRO192_-_C2_-_FE_-_SU_2023_398.webp

(Choose 1 answer)
What would happen when the following code is compiled and executed?
public class Compare {
public static void main(String args[]) { if(x < 10)println("y is " + y);System.out.printlr}}
int x = 10, y;
y = 1;if(x>= 10) y = 2;
A. The program compiles and prints y is 0 when executed.
B. The program compiles and prints y is 1 when executed.
C. The program compiles and prints y is 2 when executed
D. The program does not compile complaining about y not being initialized.
E. The program throws a runtime exception.
F. Depends on the particular implementation of the Java Virtual Machine
OF
Exit 17

Thông tin

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

Image metadata

Filename
PRO192_-_C2_-_FE_-_SU_2023_398.webp
File size
60.4 KB
Dimensions
1542px x 690px

Share this media

Back
Bên trên Bottom