1. Engineering
  2. Computer Science
  3. this question is related to java please dont answer using...

Question: this question is related to java please dont answer using...

Question details

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?

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution