basically I need to get a constant for a class however I have no instance of the object but only its class.
In PHP I would do constant(XYZ);
Is there a similar way
You might look for sth. like
Foo.class.getDeclaredField("THIS_IS_MY_CONST").get(null);
or
Class.forName("Foo").getDeclaredField("THIS_IS_MY_CONST").get(null);
(thanks f-o-o)
Gets the value of a String constant (THIS_IS_MY_CONST) in class Foo.
Update
use null as argument for get thanks acdcjunior