Public Class Car Int Modelcaryear String Modelcarname Public Car Int Caryear String Carname Modelcaryear Cary 1 (217.38 KiB) Viewed 37 times
public class Car { int modelCarYear; String modelCarName; public Car (int carYear, String CarName) { modelCarYear = carYear; modelCarName = CarName; } public static void main(String[] args) { Car myCar 1 = new Car ( 2020, "Toyota"); Car myCar2 = new Car (2021, "Nissan"); Car myCar3 = new Car(2022, "Proton"); Car myCar 4 = new Car ( 2022, "Waja"); System.out.println(myCar3.modelCarYear + " " + myCar1. modelCarName ); } } Figure 2. Cars Based on the figure above, how many parameters are in the constructors: i. One parameter ii. Two parameters iii. Three parameters iv. Four parameters O i & ii & iv оіі O i & ii iii
9.What line of code will you need to add to Deck.java to put Deck class in the right package based on Table 1? Table 1 Class name Package name my Vehicle.car Tyre Deck myVehicle.ship my Vehicle.plane Wing O a package myVehicle; O b. package myVehicle.car; O c. package myVehicle.ship.*; O d. package myVehicle.ship;
What is the output of the code below? int ff[] = new int[4]; System.out.print(ff); O a. Random memory address O b. 0000 O c. 0000 O d. Compilation Error
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!