Search code examples
javaapiclassname

Java api - Class names starting with _ [underscore]


I’m interested to know this as they are part of Java api [J2SE].

Generally it a convention to use "_" in variables name to indicate that they're instance variable or for some other special purpose [but defiantly it depends on programmer’s taste].

But there are few classes listed in Java API [J2SE], whose names are starting with underscore ("_").

Really Oracle have any special meaning/purpose for this underscore? [If yes,] Why kind of difference these classes have when compared with other classes in same API?

http://docs.oracle.com/javase/7/docs/api/

_BindingIteratorImplBase
_BindingIteratorStub
_DynAnyFactoryStub
_DynAnyStub
_DynArrayStub
_DynEnumStub
_DynFixedStub
_DynSequenceStub
_DynStructStub
_DynUnionStub
_DynValueStub
_IDLTypeStub
_NamingContextExtStub
_NamingContextImplBase
_NamingContextStub
_PolicyStub
_Remote_Stub
_ServantActivatorStub
_ServantLocatorStub


Solution

  • Generally it a convention to use "_" in variables name to indicate that they're instance variable or for some other special purpose

    Not in Java. A convention of this kind is required in C++ because of the constructor syntax for member variables. There is no such requirement in Java, hence it is rarely used, and only by people who appear to think they're still programming in C++.

    The classes you mention were all defined by OMG in the early 1990s according to the naming restriction imposed by CORBA IDL, which again have nothing to do with Java.