The only solution I can find is to define an "Constants Interface" like this:
interface Constants
{
static final public int SUCCESS=1;
static final public int FIAL=0;
... ...
}
Then, every class in the package using these constants has to implement this
interface.
An abstract final class defining these constants is an alternative, but then I
have to site the class name when using the constants, like this:
if( dosth()==Constant.SUCCESS)
{... ...}
Im wondering if there is any other better solutions to define package constant
s? You know, Im some kind of new comer to java but am involved in a java proj
ect now.
Thank you very much.
interface Constants
{
static final public int SUCCESS=1;
static final public int FIAL=0;
... ...
}
Then, every class in the package using these constants has to implement this
interface.
An abstract final class defining these constants is an alternative, but then I
have to site the class name when using the constants, like this:
if( dosth()==Constant.SUCCESS)
{... ...}
Im wondering if there is any other better solutions to define package constant
s? You know, Im some kind of new comer to java but am involved in a java proj
ect now.
Thank you very much.