IMG-LOGO

Câu hỏi:

14/10/2022 58

A variable that is declared protected:

A. Is visible only in the subclasses (and not in the class it is declared in)

B. Is visible only in the class it is declared in

C. Is visible to all classes, but modifiable only in the class where it is declared

D. Is visible in the class it is declared in, and all of its sub-classes

Đáp án chính xác

Trả lời:

verified Giải bởi Vietjack

Chọn D

Câu trả lời này có hữu ích không?

0

CÂU HỎI HOT CÙNG CHỦ ĐỀ

Câu 1:

Which of the following keywords do you think can be used when declaring static members in a class?
(i) Public
(ii) Private
(iii) Protected

Xem đáp án » 14/10/2022 105

Câu 2:

In the following program, how many times Base’s constructor will be called?
Media VietJack

Xem đáp án » 14/10/2022 89

Câu 3:

What is the output of the following code?
Media VietJack

Xem đáp án » 14/10/2022 89

Câu 4:

Lệnh nào sau đây là SAI?

Xem đáp án » 14/10/2022 88

Câu 5:

If a class declares a variable static, this means:

Xem đáp án » 14/10/2022 86

Câu 6:

Kết quả đoạn lệnh sau là bao nhiêu? For (int i = 0,n = 5; n != i; i++,n--) cout << i << “,”;
Media VietJack

Xem đáp án » 14/10/2022 83

Câu 7:

What makes a class abstract?

Xem đáp án » 14/10/2022 82

Câu 8:

Lệnh nào sau đây định nghĩa một hằng giá trị?

Xem đáp án » 14/10/2022 81

Câu 9:

Hàm overloaded là những hàm như thế nào?

Xem đáp án » 14/10/2022 80

Câu 10:

Cách khai báo hàm nào sau đây là đúng?

Xem đáp án » 14/10/2022 78

Câu 11:

Nguyên lý của cấu trúc while là:

Xem đáp án » 14/10/2022 73

Câu 12:

Kết quả đoạn lệnh sau là bao nhiêu?
Media VietJack

Xem đáp án » 14/10/2022 71

Câu 13:

Đoạn lệnh sau có kết quả bao nhiêu?
Media VietJack

Xem đáp án » 14/10/2022 70

Câu 14:

What is the output of the following code?
Media VietJack

Xem đáp án » 14/10/2022 69

Câu 15:

Quy tắc đặt tên biến nào sau đây là đúng?

Xem đáp án » 14/10/2022 67