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.
To know about the basics of Java see What is Java?
Pass your comments and suggestions on this tutorial "Java Data Types".