Junior — Middle
What control instructions have you used in your previous project?
sobes.tech AI
Answer from AI
In Java, I used the following control statements:
- Conditional operators:
if,if-else,switch— for branching logic depending on conditions. - Loops:
for,while,do-while— for repeating blocks of code. - Transition operators:
breakandcontinue— for controlling loop execution. - Exception handling:
try-catch-finally— for catching and handling errors during execution.
Example of using a conditional operator and a loop:
for (int i = 0; i < 10; i++) {
if (i % 2 == 0) {
System.out.println(i + " - even number");
} else {
System.out.println(i + " - odd number");
}
}