Skip to content

Instantly share code, notes, and snippets.

@skooltch84
Last active October 10, 2016 01:30
Show Gist options
  • Save skooltch84/eba1c118aefd58c18629ae916131a300 to your computer and use it in GitHub Desktop.
Save skooltch84/eba1c118aefd58c18629ae916131a300 to your computer and use it in GitHub Desktop.
class Car {
public readonly int NumberOfWheels; //readonly keyword doesn't allow user to change the values
private readonly int NumberOfDoors
//Car Constructor Method which takes parameters of NumberOfWheels and NumberOfDoors
public Car(int NumberOfWheels, int NumberOfDoors){
//Initializing the fields with method level variables
NumberOfWheels = numberOfWheels;
NumberOfDoors = numberOfDoors;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment