Every value has a type that decides what it can hold and how it behaves. Three basics: int (whole numbers), double (numbers with a fractional part), and boolean (true/false).
int
double
boolean
true
false
int holds whole numbers: int age = 30;. double holds fractional numbers: double price = 9.99;. boolean holds a logical value: boolean ok = true;.
int age = 30;
double price = 9.99;
boolean ok = true;
▶ Try it: run this, then change something and run it again.
Sort each value into the type that best fits it.
Which type holds only true or false?
Match each value to its type.
Which type would you use to store a price like 9.99?
9.99
Type exactly what this program prints.
public class Main { public static void main(String[] a){ boolean ready = false; System.out.println(ready); }}