The Java Programming Language reserves some special words that are not allowed to be used as variable names by Java programmers. Let’s talk about the keyword case. The keyword case goes together with the switch keyword as part of a control flow statement.
Because Java uses case as part of the switch/case control flow, you are not allowed to use case as a variable name in your program.
The code snippet below shows you why the keyword case is a reserved word in Java.
//Perform a task when integer equals 1
//Perform a task when integer equals 2