Overview of Java Data Types


<aside> <img src="/icons/table_red.svg" alt="/icons/table_red.svg" width="40px" /> Table of Contents

</aside>

<aside> 💡

  1. Data Types in Java </aside>

<aside> 💡

  1. Primitive and Non Primitive Data Types in Java </aside>

Data Types in Java


  1. Java Data Types

    1. Java is statically typed and also a strongly typed language because, in Java, each type of data (such as integer, character, hexadecimal, packed decimal, and so forth) is predefined as part of the programming language and all constants or variables defined for a given program must be described with one of the Java data types.

  2. Data Types in Java

    1. Data types in Java are of different sizes and values that can be stored in the variable that is made as per convenience and circumstances to cover up all test cases. Java has two categories in which data types are segregated

    2. Primitive Data Type: such as boolean, char, int, short, byte, long, float, and double. The Boolean with uppercase B is a wrapper class for the primitive data type boolean in Java.

    3. Non-Primitive Data Type or Object Data type: such as String, Array, etc.

      image.png


Primitive and Non Primitive Data Types in Java