I'm trying to compare a class type passed through as an object to the class type on the other side where the method is.
How can I do this?
I have this so far.
The one side:
TechToday techToday = new TechToday(); SoftwareRevolution softwareRevolution = new SoftwareRevolution(); Subcriber s1 = new Subcriber(); s1.Subcribe(techToday); s1.Subcribe(softwareRevolution); The other side:
class Subcriber { TechToday tt = new TechToday(); SoftwareRevolution sr = new SoftwareRevolution(); public void Subcribe(Object s) { if(s==tt) new ConsoleObserver(s); else new ConsoleOutput(s); } }
if (s == tt)doif (s is TechToday) { new ConsoleObserver (s as TechToday); }