1Default constructor is a constructor created by compiler; if user does not
2create a constructor in a class.
3If user defines a constructor in a class then java compiler will not create
4default constructor.
1public class Vehicle {
2 protected String vin;
3 protected int modelYear;
4
5 public Vehicle() { }
6
7 public Vehicle(String vin) {
8 this.vin = vin;
9 }
10
11 public Vehicle(String vin, int modelYear) {
12 this.vin = vin;
13 this.modelYear = modelYear;
14 }
15}