- Executores
-
Aprender
Aprender Python Exemplos executáveis, NumPy, pandas e mais Aprender IA / Machine LearningRedes neurais, ML e LLMs do zero Aprender C e C++ Ponteiros, memória, STL e C++ moderno Aprender C#Fundamentos, POO, LINQ, async e exercícios .NET Aprender MatplotlibGráficos de linha, barras, dispersão e pizza com visualizadores Aprender RustOwnership, traits, tratamento de erros e threads Aprender GoSlices, interfaces, goroutines e channels Algoritmos em Python Busca, ordenação, recursão e visualizações O(n) Algoritmos em C e C++ Compare implementações em C e C++ Programação para crianças Aprenda a programar brincando!
- QuizzesNovo
- DesafiosNovo
- Para professoresNovo
- Atualizações
- Me pague um café
Quiz de Java: if, switch & Loops
This Java control flow quiz checks how if, switch, for, while and do-while really run. You will trace loops with break and continue, catch switch fall-through and spot loops that never end or run past an array.
Pergunta de exemplo
Pergunta 1 de 10What does this print?
public class Main {
public static void main(String[] args) {
int day = 2;
switch (day) {
case 1: System.out.print("A");
case 2: System.out.print("B");
case 3: System.out.print("C");
break;
default: System.out.print("D");
}
System.out.println();
}
}
Mostrar a resposta
C. BC The switch jumps to case 2 and then falls through into case 3 because there is no break after B. The break after C stops it before default.
O que este quiz cobre
- Classic
switchfall-through andbreak - Switch expressions with
-> for, enhancedfor,whileanddo-whilebreakandcontinue- Common bugs like off-by-one and infinite loops
Perguntas frequentes
Preciso de uma conta?
Não. Qualquer pessoa pode jogar. Entre para guardar seu XP, sequência, badges e histórico.
Posso refazer?
Pode. Sua melhor nota fica salva, e as perguntas e respostas são embaralhadas a cada vez.