("Value Declared using Byte Data Type is " + byteData) Long longData = 20000000000000L // declaring long data typeįloat floatdata= 1.1f // declaring float data typeĭouble doubleData = 29.94d // declaring double data typeīoolean booleanData= true //declaring boolean data typeĬhar charData = 'A' // declaring character data type Short shortData= 6000 //declaring short data type Int intData= 20 // declaring integer data type In this example, we will show how to use different primitive types available in java programming:īyte byteData= 88 //declaring byte data type It can be used for storing only a single character, letter or ASCII values. It can be used for storing numbers having 15 decimal digits. It can be used for storing numbers having 6 to 7 decimal digits Stores positive and negative numbers ranging from -32,768 to 32,767. Stores positive and negative numbers ranging from -128 to 127. Here is a table showing different data types along with size: Primitive Data Type It can be used to store only a single character.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |