

MCQOPTIONS
Saved Bookmarks
This section includes 9 Mcqs, each offering curated multiple-choice questions to sharpen your Java Programming knowledge and support exam preparation. Choose a topic below to get started.
1. |
What is the correct option with regards to below snippet?
|
A. | QuickCustomer can be replaced with RegCustomer |
B. | We can instantiate objects of NewCustomer |
C. | NewCustomer can be replaced with RegCustomer |
D. | RegCustomer can be replaced with QuickCustomer |
E. | None of these |
Answer» D. RegCustomer can be replaced with QuickCustomer | |
2. |
What is the output of this program?
|
A. | 0 4 16 |
B. | 4 0 16 |
C. | 16 0 4 |
D. | Compilation Error |
E. | Runtime Error |
Answer» B. 4 0 16 | |
3. |
What is the output of this program?
|
A. | 25 1 |
B. | 1 25 |
C. | 0 5 |
D. | 5 0 |
E. | None of these |
Answer» B. 1 25 | |
4. |
What is the output of this program?
|
A. | 0 |
B. | 4 |
C. | 16 |
D. | Compilation Error |
E. | Runtime Error |
Answer» D. Compilation Error | |
5. |
What is the output of below snippet?
|
A. | Runs successfully |
B. | Compilation Error |
C. | IOException |
D. | Runtime Error |
E. | None of these |
Answer» B. Compilation Error | |
6. |
Does close() implicitly flush() the stream. |
A. | False |
B. | True |
C. | NA |
D. | NA |
E. | NA |
Answer» C. NA | |
7. |
Can abstract keyword be used with constructor, Initialization Block, Instance Initialization and Static Initialization Block. |
A. | False |
B. | True |
C. | NA |
D. | NA |
E. | NA |
Answer» C. NA | |
8. |
Which of the following is the correct way of implementing an interface salary by class company? |
A. | class company imports salary {} |
B. | class company extends salary {} |
C. | class company implements salary {} |
D. | All of above |
E. | None of these |
Answer» D. All of above | |
9. |
Which of the following is the correct way of implementing an interface N by class M? |
A. | class M imports N{} |
B. | class M extends N{} |
C. | class M implements N{} |
D. | All of above |
E. | None of these |
Answer» D. All of above | |