Data types and variables in Java

The data type specifies the size and type of values that can be stored in an identifier. Variables are the entities that include values and data that act or are acted upon. All variables must have a data type.

Data types

A data type is a classification of data, which can store a specific type of information. Data types are primarily used in computer programming, in which variables are created to store data. Each variable is assigned a data type that determines what type of data the variable may contain.

The term data type and primitive data type are often used interchangeably.

  • Primitive data type: Primitive data types are predefined types of data, which are supported by the programming language. For example, integer ...

Get Learning Selenium Testing Tools - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.