示例#1
0
文件: Program.cs 项目: pritinp/CSharp
 /*
  * -this method doesn't return anything as it's set to 'void'
  * -why are the parameters 'Car car' passed in here? The small case 'car' is the input parameter, and the large case 'Car' is the datatype.Google Passing datatypes into methods.
  * -Therefore, I think it's essentialy doing the same as the following...
  *    private static void printCarDetails(string inputParameter) // where 'string' is the 'data type'
  * - When passing objects into methods as parameters you need to state it's 'data type' first....
  *  private static void printCarDetails(<datatype variable_name)
  *  eg.
  *  private static void printCarDetails(Car _car)
  * -reference from video: Video 15 @ 18m 43sec - input parameter names
  */
 // the myCar object is passed into this 'helper' method as a parameter (you need t pass it in as '<datatype> <variable>'
 //      where the variable holds the myCar object
 // the helper method utiliss the built in method of the car class called 'FormatMe'
 private static void printVehicleDetails(Vehicle vehicle)
 {
     Console.WriteLine("Here are the vehicle's details: {0}",
                       vehicle.FormatMe());
 }
示例#2
0
 private static void printVehicleDetails(Vehicle vehicle)
 {
     Console.WriteLine("Here are the Vehicle's details: {0}",
         vehicle.FormatMe());
 }
示例#3
0
 public static void PrintVehicledetails(Vehicle vehicle)
 {
     Console.WriteLine("Vehicle details  : {0}",vehicle.FormatMe());
 }
示例#4
0
 public static void PrintVehicledetails(Vehicle vehicle)
 {
     Console.WriteLine("Vehicle details  : {0}", vehicle.FormatMe());
 }
示例#5
0
 private static void printVehicleDetails(Vehicle car1)
 {
     Console.WriteLine("Here are the Car's details: {0}", car1.FormatMe());
 }