Can I make interfaces or abstract classes in C# that declare methods with a parameter of unknown type?

Are you maybe looking for something like this public abstract class Parameter { public bool IsSet { get; protected set; } protected Parameter() { IsSet = false; } public abstract void Set(T value); public T Value; } public class IntParameter : Parameter { public override void Set(int value) { Value = value; IsSet = true; } } Have a look at An Introduction to C# Generics.

Damn, faster. :) +1 – Benjamin Podszun Feb 22 '10 at 13:08 Man, ask a stupid question... That's exactly what I need. Generics should have been the first thing I thought of.

:) Thank you very much! – McMuttons Feb 22 '10 at 13:12 Just as an additional comment, with generics I didn't even need inheritance anymore, but could do it with just a single class, which is even better. :) – McMuttons Feb 22 '10 at 14:16.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions