August 2017
Beginner
566 pages
12h 34m
English
Now enter the following beneath the open bracket under public class Vehicles:
private string make;private string model;
These are two instance variables placed inside the Vehicles class.
Let's make the constructor here. So now you're going to type this after the preceding lines:
public Vehicles(string mk, string mod)
This is a parametrized constructor. You have to set the instance variables inside it. So type the following between curly braces beneath this line:
make = mk; model = mod;
So, to review, add the following comment as shown. These are two instance variables:
private string make; //instance variables
Inside the constructor, you set the instance variables. So, enter the following comment directly above ...
Read now
Unlock full access