java - What are auxiliary classes? -


i know these questions may sound stupid, in java, auxiliary classes, how 1 write one, , how compiler know auxiliary class?

edit: reason ask because compiler generating warning regarding object in external library, , want know why.

edit 2:

here compiler warning want it:

warning: auxiliary class pattern in jregex/pattern.java should not accessed outside own source file 

as descried in java specification here, can specify more 1 class in 1 .java file. class name matches .java file name main class can declared public , visible other classes. other classes in file therefore "auxilary" classes. auxilary class can not declared public , (as @trashgod rightfully pointed out) therefore declared package-private access. instance aclass.java file:

public class aclass {     private auxilaryclass a; } class auxilaryclass {     private int b; } 

auxilaryclass class can't public , not visible outside aclass.java file.

however, using auxilary classes considered extremely bad style , against java code convention. please use separate or inner classes if needed.

edit: term "auxilary" not oracle/sun official terminology. has been introduced (or used) here: http://www.youtube.com/watch?v=mitm9ry3he0 and/or here: http://doc.sumy.ua/prog/java/langref/ch05_03.htm


Comments

Popular posts from this blog

java - WrongTypeOfReturnValue exception thrown when unit testing using mockito -

php - Magento - Deleted Base url key -

android - How to disable Button if EditText is empty ? -