Re: Constants class nickname problem
Guy wrote:
I invoke it in my code as
function( arg1, MediVisitInstallConst.CONFIG_MI,...etc);
Sorry that was a typo, the .Bean is required and is the whole purpose:
function( arg1, MediVisitInstallConst.Bean.CONFIG_MI,...etc);
If you copy-and-paste directly from source you avoid typos.
..NET is not Java. Java is not .NET. In Java the "static" keyword means
"belonga-class". A top-level class has no other class to which it can belong,
ergo "static" makes no sense there.
Other than that I see no problem with the scheme
Constants.Bean.CONFIG_MI, Constants.Xml.SOMETHING, ...
other than stylistic.
I try to declare:
MediVisitInstallConst const;
But when I try to use it:
function( arg1, const.CONFIG_MI,...etc), the compiler complains:
"unexpected type: required class, package, fond variable"
Your "const" variable was also missing the "Bean" reference.
Try "function( arg1, const.Bean.CONFIG_MI, ... )"
Second, I have several constants and I like to regroup them in the
same package,
I see that you have them grouped in different nested classes within the same
outer class, which trivially puts them in the same package.
- Lew