Variable (Java)

A variable in Java is a named container that stores a value. Because Java is statically typed, you must declare a variable's type when you create it, and it…