Add `--enable-html-docs` to distcheck flags
[geany-mirror.git] / tests / ctags / keyword_class.cs
blob0b44c3c1db56d80dd58e2dbe6decd55e7481f320
1 // keyword_class.cs
2 // class example
3 using System;
4 public class Kid
6 private int age;
7 private string name;
9 // Default constructor:
10 public Kid()
12 name = "N/A";
15 // Constructor:
16 public Kid(string name, int age)
18 this.name = name;
19 this.age = age;
22 // Printing method:
23 public void PrintKid()
25 Console.WriteLine("{0}, {1} years old.", name, age);
29 public class MainClass
31 public static void Main()
33 // Create objects
34 // Objects must be created using the new operator:
35 Kid kid1 = new Kid("Craig", 11);
36 Kid kid2 = new Kid("Sally", 10);
38 // Create an object using the default constructor:
39 Kid kid3 = new Kid();
41 // Display results:
42 Console.Write("Kid #1: ");
43 kid1.PrintKid();
44 Console.Write("Kid #2: ");
45 kid2.PrintKid();
46 Console.Write("Kid #3: ");
47 kid3.PrintKid();