예제 #1
0
 static bool f2()
 {
     Person p1 = new Person("1342", "anna");
     Console.WriteLine(p1.whoAreYou("eva"));
     return false;
 }
예제 #2
0
 public void print(Person p)
 {
     Console.WriteLine(p.Name);
 }
예제 #3
0
 static void d()
 {
     Person p1 = new Person("1", "anna");
     Person p2 = new Person("2", "data");
     Person p3 = p1 * p2;
     p3.print(p3);
 }
예제 #4
0
 static void c()
 {
     IMyInterface1 imi;
     Person p1 = new Person("1342", "data");
     imi = p1 as IMyInterface1;
     Console.WriteLine(imi.whoAreYou(imi) + "\n");
 }
예제 #5
0
 static void b()
 {
     Person p1 = new Person("1", "anna");
     Uppgift1 u = new Uppgift1();
     Console.WriteLine(u.Temp(p1) + "\n");
 }
예제 #6
0
 static void a()
 {
     Person p1 = new Person("1", "anna");
     Person p2 = p1;
     p2.print();
     object o = p2;
     Console.WriteLine(o.GetType() + "\n");
 }
예제 #7
0
 public new void print(Person p)
 {
     string s = "Mina studenter ";
     s += p.Name;
     s += teacher.Insert(8, " älskar sina");
     Console.WriteLine("Result =" + "\n" + s + "\n" + p.id + "\n");
 }