1. What is the output of the given code?
public class Test{
public static void main(String []args){
for(int i = 0; i < 10; i++){
if(i % 2 == 0){
continue;
}
System.out.println(i);
}
}
}
Ans. program will print all odd numbers between 0 to 10.
2. Where can the “break” statement be used in Java?
Ans. Inside both a loop and switch statement.
