Jesper Nordenberg wrote:
This might be slightly off topic, but I really need help with this.

Is there any way to obtain the Class-instance associated with the current class in a static method? Obviously, this.getClass() doesn't work ;)
 

You can use the static method Class.forName() on the Class class itself.

So, if your static method is in the class 'bar' in the package 'com.foo', the fragment:

Class cl = Class.forName("com.foo.bar");

will give you the Class-instance you're looking for.

--
David Marshall                  email:  [EMAIL PROTECTED]
President                       phone:  1-941-596-2480
VM Systems, Inc.                fax:    1-941-596-2483
 

 



Reply via email to