Exemplo n.º 1
0
 static bool f2()
 {
     Person p1 = new Person("1342", "anna");
     Console.WriteLine(p1.whoAreYou("eva"));
     return false;
 }
Exemplo n.º 2
0
 public void print(Person p)
 {
     Console.WriteLine(p.Name);
 }
Exemplo n.º 3
0
 static void d()
 {
     Person p1 = new Person("1", "anna");
     Person p2 = new Person("2", "data");
     Person p3 = p1 * p2;
     p3.print(p3);
 }
Exemplo n.º 4
0
 static void c()
 {
     IMyInterface1 imi;
     Person p1 = new Person("1342", "data");
     imi = p1 as IMyInterface1;
     Console.WriteLine(imi.whoAreYou(imi) + "\n");
 }
Exemplo n.º 5
0
 static void b()
 {
     Person p1 = new Person("1", "anna");
     Uppgift1 u = new Uppgift1();
     Console.WriteLine(u.Temp(p1) + "\n");
 }
Exemplo 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");
 }
Exemplo 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");
 }