The control statements, as the name suggests controls the flow of the program. Depending upon the state ( values of variables, user input etc ) the appropriate code is executed. These help in executing or by passing certain parts of the code, or executing them multiple times or skipping some lines of code etc.,.
These control statements in Java can be used together and they can be nested in one other. A program might contain multiple control statements, having them used in the same blocks of code or they can be nested. There is no limitation on the usage of these statements.
The control statements in java are of following types :
![]()
|