Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java api - Class names starting with _ [underscore]

Tags:

java

classname

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

like image 735
Venkatesh Achanta Avatar asked Dec 10 '25 14:12

Venkatesh Achanta


2 Answers

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.

like image 129
user207421 Avatar answered Dec 13 '25 04:12

user207421


Those classes are not really Java classes, they are part of the CORBA implementation and are generated from programming-language-independent IDL definitions - the naming convention is a CORBA one.

like image 23
Ian Roberts Avatar answered Dec 13 '25 02:12

Ian Roberts



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!