200+ câu trắc nghiệm Lập trình cho di động có đáp án - Phần 6

Đầu ra của chương trình sau là bao nhiêu?javaclass variable_scope{public static void main(String args[]){int x;x = 5;{int y = 6;System.out.print(x + " " + y);}System.out.println(x + " " + y);

14/19

Đầu ra của chương trình sau là bao nhiêu?

class variable_scope

{

public static void main(String args[])

{

int x;

x = 5;

{

int y = 6;

System.out.print(x + " " + y);

}

System.out.println(x + " " + y);

}

}

Chọn một:

5 6 5 6

5 6 5

runtime error

compilation error

Giải thích

Chọn đáp án D