PRO192_-_QUIZ2_-_SL4_3930.webp
Hữu Vinh

PRO192_-_QUIZ2_-_SL4_3930.webp

// Assume getters and setters are present
public class TestVehicle {
public static void main(String[] args) {
}
Car car = new Car("Sedan", 4);
System.out.println(car.getType());
What will be the result of compiling and running the 'TestVehicle` class?
a.
It will print "Sedan"
O b. Runtime error because the Car class does not have a default constructor
c. It will print "Vehicle"
d. Compilation error due to the getType() method being undefined in the Car class

Thông tin

Category
PRO192
Thêm bởi
Hữu Vinh
Ngày thêm
Lượt xem
759
Lượt bình luận
2
Rating
0.00 star(s) 0 đánh giá

Share this media

Back
Bên trên Bottom