PRO192_-_C1_-_RE_-_SU_2023_545.webp
Hoàng Long1

PRO192_-_C1_-_RE_-_SU_2023_545.webp

(Choose 1 answer)

Consider the following class:
1. class Test {
2 void foo(int i) {
3.
System.out.println("int version");
5.void foo(String s) {
4.}
6.System.out.println("String version");
7. } 8.
9. public static void main(String args[]) {
10.
11.
12.
Test t = new Test();char ch = 'p';
t.foo(ch);
13. } 14.}
Which of the following statements is true?
A. Line 5 will not compile, because void methods cannot be overridden.
B. Line 12 will not compile, because no version of foo() takes a char argument.
C. The code will compile and produce the following output: String version.
D. The code will compile and produce the following output: int version.
Exit (31

Thông tin

Category
PRO192
Thêm bởi
Hoàng Long1
Ngày thêm
Lượt xem
1,880
Lượt bình luận
15
Rating
0.00 star(s) 0 đánh giá

Image metadata

Filename
PRO192_-_C1_-_RE_-_SU_2023_545.webp
File size
61.6 KB
Dimensions
1542px x 690px

Share this media

Back
Bên trên Bottom