Sha256: 42613dcf404c7ec463c37e702646ca5537c7f521983850ece2501aa2e148fae4

Contents?: true

Size: 908 Bytes

Versions: 2

Compression:

Stored size: 908 Bytes

Contents

// property.cs
// Properties
using System;
public class Employee 
{
   public static int numberOfEmployees;
   private static int counter;
   private string name;

   // A read-write instance property:
   public string Name 
   {
      get 
      {
         return name; 
      }
      set 
      {
         name = value; 
      }
   }

   // A read-only static property:
   public static int Counter 
   {
      get 
      {
         return counter; 
      }
   }

   // Constructor:
   public Employee() 
   {
      // Calculate the employee's number:
      counter = ++counter + numberOfEmployees;
   }
}

public class MainClass
{
   public static void Main() 
   {
      Employee.numberOfEmployees = 100;
      Employee e1 = new Employee();
      e1.Name = "Claude Vige";  
      Console.WriteLine("Employee number: {0}", Employee.Counter);
      Console.WriteLine("Employee name: {0}", e1.Name);
   }
}

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ctags.rb-1.1.4 ext/vendor/ctags/Units/review-needed.r/property.cs.t/input.cs
ctags.rb-1.1.3 ext/vendor/ctags/Units/review-needed.r/property.cs.t/input.cs