xxxxxxxxxxxxxxxxx
No notes
Syntax:
C#
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace augusti2011 { public class Uppgift1 { private string name = "tenta"; static void a() { p.print(); } static void b() { p1.print(); } void bTemp(object imi) { Person p = imi as Person; p.Name = "Hata " + this; } static void c() { A a; a = p1; p1 = a as Person; } static bool f(object a, object b) { return (a.GetType() == b.GetType()); } static void d() { IMyInterface imi = p1; Console.WriteLine(b.GetType()); } static void e() { p2 = p1; Console.WriteLine(p1 == p2); } static void Main(string[] args) { a(); b(); c(); d(); e(); } } } using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace augusti2011 { class A { public void print() { base.print(); Console.WriteLine("Hej A"); } } } using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace augusti2011 { interface IMyInterface { object f(string str); } } using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace augusti2011 { class Person : A, IMyInterface { private string id; private string name; public Person() { } public Person(string id, string name) { Name = name; this.id = id; } public string Name { get { return name; } set { name = value; } } { base.print(); Console.WriteLine(Name); } public object f(string str) { return str.GetType(); } } } using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace augusti2011 { class Temp { public delegate bool MyDelegate(object x, object y); } }