Question: This question is related to java please don't answer using handwriting thank you Consider the following java application consisting of two classes, and then answer
This question is related to java
please don't answer using handwriting
thank you


Consider the following java application consisting of two classes, and then answer the questions below Class1: public class Carf private String model; private int year; public Car ) model year0 public Car (String model, int year) [ this.mode = mode ; this.yearyear; ublic String changeModel (String model) this.model -mode ; public String getModel) return model; public void changeYear (int year) this.yearyear; public int getYear yeari Class2: public class CarTester public static void main (String[] args) [ Car carlnew Car ("Toyota", 2017) system.out.printin (earl.getMode1)) System.out.println (carl.getYear O) Car car2carl; car2.Model ("Nissan"); car2.changeYear (1999); System.out.println (car2.getModel ()) System.out.println (car2.Year )) 1. Find and fix the errors in the previous application. 2. What is the output of the previous application? (What will be printed on the console window when CarTester class is executed)? 3. What are the values of (model) and (year) variables for the object variable car1 and why
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
