Generic class object?

From: Gijs Peek (gdepeek_at_hotmail.com)
Date: 03/29/05


Date: Tue, 29 Mar 2005 13:30:15 +0200

Is it possible to get the class object from a type parameter?
The following doesn't work:
public class Test<E> {
        public void test() {
                Class classObject = E.class;
        }
}

Regards,
 - Gijs Peek



Relevant Pages

  • Re: 2003 and vista
    ... What class object - did it say name? ... Best regards, ... Alex Dybenko (MVP) ...
    (microsoft.public.access.modulesdaovba)
  • Re: creating a .class file
    ... You still need the .class file. ... > If I have a Class object, serialized or somehow stored, is there any way I ...
    (comp.lang.java)
  • Re: Multiple Exception Definitions in One File
    ... > public class ExcepOne extends Exception ... > UseExceps.java:10: an enclosing instance that contains Exceps.ExcepOne ... Non-static inner class objects have a reference to their enclosing outer ... Static inner class object don't have a reference to an enclosing outer class ...
    (comp.lang.java.programmer)
  • Re: Marshaling Delegates as Struct/Class Members
    ... >I understand delegates do not need to be pinned, but its the class object ... > public class TestObject ... > value, GCHandleType type) ... > Is there an easy way to marshal delegates as part of a struct? ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Marshaling Delegates as Struct/Class Members
    ... >>I understand delegates do not need to be pinned, but its the class object ... >> public class TestObject ... >> value, GCHandleType type) ... >> Is there an easy way to marshal delegates as part of a struct? ...
    (microsoft.public.dotnet.languages.csharp)