Question

Consider the following Java code snippet  public class Car {     private String model;     private int year;     public Car(String model, int year) {         this.model = model;         this.year = year;     }     public String getModel() {         return model;     }     public void setModel(String model) {         this.model = model;     }     public int getYear() {         return year;     }     public void setYear(int year) {         if (year > 1900 && yea

A Inheritance
B Polymorphism
C Abstraction
D Encapsulation
Practice Next

Hey! Ask a query