Data Types

  • Data type: -
A data type is a term that refers to the kind of data that variable may hold in a program.
For example: -
int v;
The above statement declares an integer type variable v.
Java defines following data types: -
  • Integer: -
Java includes four types of integers: -byte, short, int, long. Java does not support unsigned integers like other programming languages including C/C++, which support unsigned integers.
  • Floating point-numbers: -
Java includes two types of floating point numbers float and double. This can be used to represent fractional value.
  • Characters: -
This includes char, which represent symbols in character set, like numbers and letters. This is done by using ASCII values.
  • Boolean: -
This include Boolean, using this we can represent, true or false values.
Enhanced by Zemanta
Previous
Next Post »