wrapper
When to use wrapper class and primitive type
Others have mentioned that certain constructs such as Collections require objects and that objects have more overhead than their primitive counterparts (memory & boxing). Another consideration is: It can be handy to initialize Objects to null or send null parameters into a method/constructor to indicate state or function. This can’t be done with primitives. Many … Read more
What is a wrapper class?
In general, a wrapper class is any class which “wraps” or “encapsulates” the functionality of another class or component. These are useful by providing a level of abstraction from the implementation of the underlying class or component; for example, wrapper classes that wrap COM components can manage the process of invoking the COM component without … Read more
Developing C wrapper API for Object-Oriented C++ code
This is not too hard to do by hand, but will depend on the size of your interface. The cases where I’ve done it were to enable use of our C++ library from within pure C code, and thus SWIG was not much help. (Well maybe SWIG can be used to do this, but I’m … Read more
Java: Integer equals vs. ==
The JVM is caching Integer values. Hence the comparison with == only works for numbers between -128 and 127. Refer: #Immutable_Objects_.2F_Wrapper_Class_Caching