No, wrappers for primitives aren't primitives. That's the point of them: They're used to wrap primitives when an object reference is required instead of a primitive (such as in a List
).
In that tree graphic, "Boolean" and "Integer" aren't class/type names, they're just labels (like "Floating-point" is).
Object
fits into that tree at the top of "Non-Primitive".
So for instance, the wrappers would be under non-primitive types:
Data Type
/ \
/ \
/ \
/ \
Primitive Types Non-Primitive Types (base class: Object)
/ / \
/ / \
Numeric Types Primitive Wrapper Types (etc.)
/ / | \
/ / | \
Integer Types Char Integer Boolean
/
/
char
(Obviously that's very incomplete.)
As I understand, Object
is a memory region that can contain any type in Java; from primitives to classes created by the programmer.
No, it's not a memory region. It's a type.
So, Object
may contain both primitive and non-primitive data types.
No, a variable, instance member, or parameter of type Object
(or any of its subtypes) can only contain an object reference, not a primitive like int
or char
. That's why we have wrappers for primitives, so we can store them (via a wrapper) where an object reference is expected.
Also note that the diagram is misleading in another way: "Floating Point" shouldn't be under "Integral." In computer science, "integral types" are integers (in mathematics, it's more complex than that). Which is why the JLS splits NumericType into IntegralType and FloatingPointType (ref).
And char
is an integral type in Java.
FWIW, my rough pass at that sketch would look something like this:

The final would hopefully be less squashed and ugly. :-) Note that I'm repeating "Types" everywhere to avoid the appearance of using class names, and I've used typeface (like your original did) to call out when I'm using keywords or class names.