練習用です。いろんなものがごちゃまぜです。
| @@ -10,7 +10,7 @@ | ||
| 10 | 10 | { |
| 11 | 11 | static void Main(string[] args) |
| 12 | 12 | { |
| 13 | - list1.start(args); | |
| 13 | + list2.start(args); | |
| 14 | 14 | Console.ReadLine(); |
| 15 | 15 | |
| 16 | 16 | } |
| @@ -0,0 +1,33 @@ | ||
| 1 | +using System; | |
| 2 | +using System.Collections.Generic; | |
| 3 | +using System.Linq; | |
| 4 | +using System.Text; | |
| 5 | +using System.Threading.Tasks; | |
| 6 | + | |
| 7 | +namespace chap02 | |
| 8 | +{ | |
| 9 | + class list2 | |
| 10 | + { | |
| 11 | + public static void start(string[] args) | |
| 12 | + { | |
| 13 | + var x = new A(); | |
| 14 | + x.Method1(); | |
| 15 | + x.Method2(); | |
| 16 | + } | |
| 17 | + } | |
| 18 | + class A | |
| 19 | + { | |
| 20 | + public void Method1() | |
| 21 | + { | |
| 22 | + Console.WriteLine("in class A"); | |
| 23 | + } | |
| 24 | + } | |
| 25 | + static class B | |
| 26 | + { | |
| 27 | + public static void Method2(this A a) | |
| 28 | + { | |
| 29 | + a.Method1(); | |
| 30 | + Console.WriteLine("in class B"); | |
| 31 | + } | |
| 32 | + } | |
| 33 | +} |