What's the use of a switch statement
Give an example of a switch statement
How many default statements can a switch statement define?
What happens when the variable value matches TUE
The difference between the if-else-if-else construct and a switch
Which argument types are accepted by a switch statement?
The value of a case label must be...
For the value of a case label, you can use expressions with variables only if..
Case values should be...
A switch statement without a break
Define a nested ArrayList and iterate through it
What happens when you try to modify the value of the loop variable in an enhanced for loop
Can you initialize an Array or modify its element through an enhanced for loop?
Why can't you remove or delete an the elements of a collection trough enhanced for loop ?
Is it possible to iterate over multiple collections or arrays the same for-each loop?
differences between do-while and while loop
What is the output of this code?
String[] programmers = {"Outer", "Inner"};
for (String outer : programmers) {
for (String inner : programmers) {
if (inner.equals("Inner"))
break;
System.out.print(inner + ":");
}
}
What is the output of this code?
String[] programmers = {"Paul", "Shreya", "Selvan", "Harry"};
for (String name : programmers) {
if (name.equals("Shreya"))
continue;
System.out.println(name);
}
Compare for and while loops
continue statement in a loop
continue statement in a nested loop
Difference between break an continue
On which types of statement can a label be added?
What is the output of this code:
String[] programmers = {"Outer", "Inner"};
outer:
for (String outer : programmers) {
for (String inner : programmers) {
if (inner.equals("Inner"))
break outer;
System.out.print(inner + ":");
}
}
What is the output of this code: