A
Arthur Dent
Hi all... Heres what im looking to do.... I have a Generic class i wrote.
Now, on another class, i want to add a method which can take in an object of
my generic class...
but the catch is, i want it to be able to take in an instance of the generic
REGARDLESS of what the "Of"
type of the generic is.
E.g. .... given a generic class MyGen(Of T)
I want to be able to write another class as such:
Class MyOther
.....
Public Sub DoIt(myarg As MyGen)
... do something ...
End Sub
.....
End Class
The editor/compiler complains though that i did not specify an "Of" on the
argument myarg.
But that is specifically what i want to do, is make a method which just
takes a MyGen instance,
regardless of its "Of"
Can i do this?
Thanks in advance,
- Arthur Dent.
Now, on another class, i want to add a method which can take in an object of
my generic class...
but the catch is, i want it to be able to take in an instance of the generic
REGARDLESS of what the "Of"
type of the generic is.
E.g. .... given a generic class MyGen(Of T)
I want to be able to write another class as such:
Class MyOther
.....
Public Sub DoIt(myarg As MyGen)
... do something ...
End Sub
.....
End Class
The editor/compiler complains though that i did not specify an "Of" on the
argument myarg.
But that is specifically what i want to do, is make a method which just
takes a MyGen instance,
regardless of its "Of"
Can i do this?
Thanks in advance,
- Arthur Dent.