Variables in Java need to be declared before they can be used in Java because it is a statically-typed language. Because of this, you need to state the type of variable you are declaring.