As many have stated more or less correctly what reference and primitive types are, one might be interested that we have some more relevant types in Java. Here is the complete lists of types in java (as far as I am aware of (JDK 11)).
Primitive Type
Describes a value (and not a type).
11
Reference Type
Describes a concrete type which instances extend Object (interface, class, enum, array). Furthermore TypeParameter is actually a reference type!
Integer
Note: The difference between primitive and reference type makes it necessary to rely on boxing to convert primitives in Object instances and vise versa.
Note2: A type parameter describes a type having an optional lower or upper bound and can be referenced by name within its context (in contrast to the wild card type). A type parameter typically can be applied to parameterized types (classes/interfaces) and methods. The parameter type defines a type identifier.
Wildcard Type
Expresses an unknown type (like any in TypeScript) that can have a lower or upper bound by using super or extend.
? extends List<String>
? super ArrayList<String>
Void Type
Nothingness. No value/instance possible.
void method();
Null Type
The only representation is 'null'. It is used especially during type interference computations. Null is a special case logically belonging to any type (can be assigned to any variable of any type) but is actual not considered an instance of any type (e.g. (null instanceof Object) == false).
null
Union Type
A union type is a type that is actual a set of alternative types. Sadly in Java it only exists for the multi catch statement.
catch(IllegalStateException | IOException e) {}
Interference Type
A type that is compatibile to multiple types. Since in Java a class has at most one super class (Object has none), interference types allow only the first type to be a class and every other type must be an interface type.
void method(List<? extends List<?> & Comparable> comparableList) {}
Unknown Type
The type is unknown. That is the case for certain Lambda definitions (not enclosed in brackets, single parameter).
list.forEach(element -> System.out.println(element.toString)); //element is of unknown type
Var Type
Unknown type introduced by a variable declaration spotting the 'var' keyword.
var variable = list.get(0);
..primitive type is where you would create the array with just int or strings
strings [or to be more accurate:String
s] are not primitive types in java – Brocatel