Please enable JavaScript.
Coggle requires JavaScript to display documents.
Primitive Data types/String - Coggle Diagram
Primitive Data types/String
int
AKA "integer",
int type holds a wide range of non-fractional number values. initialized in the form: int a = 400.
Minimum value : (-2^31)
Maximum value : (2^31)-1.
Occupies 32bits of memory
Float
Numerical data type that can hold values that range from 1.4^-45 to 3.4^38
occupies 32 bits of memory
used for floating point numbers. should not be used for numbers that require precision
Byte
Typically used for saving memory in large arrays of small numbers
takes up 8 bits of memory.
minimum value : -128
maximum value : 127
double
Numerical data type that can hold values from 4.9^-324 to 1.7^308
occupies 64 bits of memory
commonly used for representing decimals. should not be used for currency values
Short
Minimum value : -32768
Maximum value: 32767
Occupies 16 bits of memory
Typically used for the same reasons as a byte, but for a wider range of numbers
char
can hold up to 65,535 characters and a minimum of 0 characters
occupies 16 bits
represents Unicode characters
Long
Minimum value: -2^63
Maximum value: (2^63)-1
Occupies 64 bits of memories
Primitive data type used to represent integer numbers when the range of the int data type is not sufficient
Boolean
takes one of two values: true or false
used for conditions that may have one of two outcomes (yes/no, 1/0, true/false)
occupies 2 bytes
String
Not a data type but a reference class
Typically used to represent series of characters (words/sentences)
once created, it cannot change. unchangeable, immutable