Java Reference
In-Depth Information
Boxing is the process of storing a primitive value in a type wrapper object. Unboxing
is the process of retrieving the primitive value from the type wrapper. Autoboxing
automatically boxes a primitive value without having to explicitly construct an ob-
ject. Auto-unboxing automatically retrieves the primitive value from a type wrapper
without having to explicitly call a method, such as
intValue( )
.
The solution is
Static import brings into the global namespace the static members of a class or inter-
face. This means that static members can be used without having to be qualified by
their class or interface name.
The statement brings into the global namespace the
parseInt( )
method of the type
wrapper
Integer
.
static members of all classes into view?
Static import is designed for special cases. Bringing many static members into view
will lead to namespace collisions and destructure your code.
interface
11
.
What is a marker annotation?
A marker annotation is one that does not take arguments.
False. Any type of declaration can have an annotation. Beginning with JDK 8, a type
use can also have an annotation.
Chapter 13: Generics