0
There are variable types for many different types of numbers, and these vary by programming language. Iâm most familiar with Java.
Variable Types
char
a single character
must be in âsingle quotesâ
Size: 2 bytes
ex. âCâ âzâ â!â â%â â â
String
a string of characters
must be in âquotesâ
Size of Strings depend on how long they are
byte
number
Size: 1 byte
short
number
Size: 2 bytes
int
an integer (whole) number
Size: 4 bytes
Ex. ⊠-3, -2, -1, 0, 1, 2, 3âŠ
long
A long number
Size: 8 bytes
float
a floating point decimal number
Size: 4 bytes
double
a floating point decimal number
Size: 8 bytes
boolean
true or false
Size: 1 byte