PRO192_-_SP_2024_-_Block_5_-_FE_1921.webp
K

PRO192_-_SP_2024_-_Block_5_-_FE_1921.webp

Multiple Choices
(Choose 2 answers)
(select 2)
Shape and Main are defined in the same package, examine the code and select the correct statements.
line1> class Shape {
line2>public void print() {
System.out.println("Shape");
line3>line4>
}
line5> }
line6> class Main {
line7>public static void main(String... args) {
line8>line9Shape anShape = new Shape();
> anShape.print();
line10>}
line11> }
A. The class Main will print Shape.
B. If the code on line 2 is changed as follows, the class Main will print Shape:
private void print() {
C. If the code on line 2 is changed as follows, the class Main will print Shape:
void print() {
D. If the code on line 2 is changed as follows, the class Main will print Shape:
default void print() {

Thông tin

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

Share this media

Back
Bên trên Bottom