Java Data Types

Java Data Types

Java Data Types Meaning Functionality explained.

Every programming language comes with data types. As the name indicates, data type is required to store values (data) in a program. Depending on the nature of value to store, suitable data type should be chosen. For example to store a whole number like 10, 20, choose int data type, and for floating-point number like 10.5 or 20.75 etc. choose a double data type.

Java data types are different from other languages like C/C++. Two significant features may be noted.

1. In C/C++, the unassigned variables are given garbage values. In contrast, Java unassigned variables are not given garbage values. Here, Java observes two rules. Unassigned local variables are given compilation error and instance (global) variables are given default values.
2. A new data type boolean is introduced which does not exist in C/C++. In C/C++, it is achieved through flags.

Many postings exist in way2java.com to explain data types.

1. Primitive Data Types
2. Data Types Default Values – No Garbage
3. Strongly typed language
4. Backslash in Java
5. Java Keywords
6. How a Bytecode looks?

To know about the basics of Java see What is Java?

Pass your comments and suggestions on this tutorial "Java Data Types".

Leave a Reply

Your email address will not be published. Required fields are marked *