I have a set of point classes that derive from abstract POINT.

I would like the end user to be able to define a point eg pointndimention : POINT.

it would be nice for the static method random to be able to know which kind of point to randomize by defining a type that implements POINT without being able to pass any other type at all and without passing an object of type POINT.

eg.

POINT12D p=new POINT12D; p=POINT.random(POINT12D);

public abstract class POINT { public abstract POINT _Add(POINT a,POINT B)/>/>; ... public abstract POINT _Random(); public abstract POINT _Norm(POINT p); public abstract POINT _Inverse(POINT p); public abstract POINT _Mean(POINT[] p);[/indent] public static POINT Add(POINT a, POINT B)/>/> { return a._Add(a,B)/>/>; } public static POINT Minus(POINT a, POINT B)/>/> { return a._Minus(a,B)/>/>; } ... public static POINT Random(POINT Type t) { return typeof(t).Random();//<-----A BIT LIKE THIS } ... } Point2d: POINT { ... public override POINT _Random() { return new point2d(r.next(),r.next()); } }

I have goggled alot and keep coming across generic classes but not what Im trying to do.

Any help would be very appreciated.

Thankyou