In Java, every variable is a typed slot for data: you declare what kind of value it can hold before storing anything inside it. Static typing catches typos and mismatched values in javac long before the code ever executes.
More lessons in Complete Core Java