so suppose I have
class B extends A{}
and B contains a whole bunch of class constants
Is there a way to define a static function in A that would fetch all class constants in the calling child class?
So for example is there a way to define static function getChildConstants()
in A
such that if you call B::getChildConstants()
(B can access this function since B extends A), this function would return all the class constants in B. Moreover, this function must be defined in A only. ie, I don't want to have to reimplement getChildCosntants() in B.
This is so that for any class that extends A, I can easily get the constants of such class without having to reimplement/rewrite/copy and paste getChildConstants() into chose children classes over and over again
so I want a universal constants fetching function in A such that for any class that extends A, I can get the class constants of such class by simply calling this universal constants fetching function that was defined in A
I must reiterate that the getChildConstant() function must be static