Exemple #1
0
 // Printing method:
 public void printEmployee()
 {
     Console.WriteLine("Name: {0}\nAlias: {1}", name, alias);
     // Passing the object to the CalcTax method by using this:
     Console.WriteLine("Taxes: {0:C}", Tax.CalcTax(this));
 }
Exemple #2
0
 //Printing
 internal void printEmployee()
 {
     Console.WriteLine("Name: {0} \n Alias: {1} \n Salary: {2} ", name, alias, salary);
     //Passing the object to the CalcTax method by using 'this'"
     Console.WriteLine("Taxes: {0:C} \n", Tax.CalcTax(this));
 }