PRO192_-_C1_-_FE_-_SU_2023_391.webp
H

PRO192_-_C1_-_FE_-_SU_2023_391.webp

(Choose 1 answer)
Consider the following class:
1 . class Test {
void foo(int i) {
System.out.println("int version");
2345678 4. } 5.6
void foo(String s) { . System.out.println("String version");
7. }
9. public static void main(String args[]) {
10.Test t = new Test();
11.
char ch = 'p';t.foo(ch);12.
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.
Edt (15)

Thông tin

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

Image metadata

Filename
PRO192_-_C1_-_FE_-_SU_2023_391.webp
File size
71.7 KB
Dimensions
1713px x 893px

Share this media

Back
Bên trên Bottom