In this example you will learn what is identifier and primitive data types of
a identifier. This tutorials will teach you how to use these identifier in
you java programming. Identifier is is a simple variable name
which is defined as the value container. The type of value stored by identifier
is defined by the special java keyword is termed as
primitive data type.
In the given example there are some identifiers have been used like byteident, shortident, intident, longident, charident, stringident, floatident, doubleident. And there are some primitive data types of used identifiers have been also used in the program like byte, short, int, long, float, double, char and String.
All the data type has it's own capacity to keep the maximum value. Which have been mentioned below :
Source: http://java.sun.com/docs/books/tutorial/java/nutsandbolts/datatypes.html
Code of the Program :
Download Identifier and primitive data types Example
In the given example there are some identifiers have been used like byteident, shortident, intident, longident, charident, stringident, floatident, doubleident. And there are some primitive data types of used identifiers have been also used in the program like byte, short, int, long, float, double, char and String.
All the data type has it's own capacity to keep the maximum value. Which have been mentioned below :
Keyword | Description | Size/Format |
---|---|---|
Integers | ||
byte |
Byte-length integer | 8-bit two's complement |
short |
Short integer | 16-bit two's complement |
int |
Integer | 32-bit two's complement |
long |
Long integer | 64-bit two's complement |
Real numbers | ||
float |
Single-precision floating point | 32-bit IEEE 754 |
double |
Double-precision floating point | 64-bit IEEE 754 |
Other types | ||
char |
A single character | 16-bit Unicode character |
boolean |
A boolean value (true or false ) |
true or false |
public class identifierandpdatatype{ named 'byteident' which primitive data type is byte."); identifire named 'shortident' which primitive data type is short."); of identifire named 'intident' which primitive data type is int."); of identifire named 'longident' which primitive data type is long."); of identifire named 'charident' which primitive data type is char."); of identifire named 'stringident' which primitive data type is string."); of identifire named 'floatident' which primitive data type is float."); of identifire named 'doubleident' which primitive data type is double.");
|
Download Identifier and primitive data types Example
No comments:
Post a Comment