Skip to content
UoL CS Notes

Data Types

COMP122 Lectures

Java is strongly typed. This means that all types consist of a value and a type.

Types of Types

There are two different types of type in Java.

Primitive

  • int, byte, short and long
  • float, and double
  • char
  • boolean

Composite

  • string
  • Arrays e.g. int[]

Literals

Literal values are the actual value of some type that occurs.

  • 0 or 574489 are literals of type int
  • true and false are literals of type boolean