- Esecutori
-
Impara
Impara Python Esempi eseguibili, NumPy, pandas e altro Impara l'IA / Machine LearningReti neurali, ML e LLM da zero Impara C e C++ Puntatori, memoria, STL e C++ moderno Impara C#Fondamenti, OOP, LINQ, async ed esercizi .NET Impara MatplotlibGrafici a linee, barre, dispersione e torta con visualizzatori Impara RustOwnership, trait, gestione degli errori e thread Impara GoSlice, interfacce, goroutine e canali Algoritmi Python Ricerca, ordinamento, ricorsione e visualizzazioni O(n) Algoritmi C e C++ Confronta le implementazioni in C e C++ Programmazione per bambini Impara a programmare giocando!
- QuizNuovo
- SfideNuovo
- Per docentiNuovo
- Aggiornamenti
- Offrimi un caffè
Quiz di Java: Operators & Integer Division
This Java operators quiz focuses on the results that surprise beginners, above all integer division. You will predict output with /, %, ++, compound assignment and string concatenation, and see why && can protect you from an exception.
Domanda di esempio
Domanda 1 di 10What does this print?
public class Main {
public static void main(String[] args) {
System.out.println(7 / 2);
}
}
Mostra la risposta
B. 3 Both operands are int, so Java does integer division and drops the fraction (it does not round). The result is the int 3.
Cosa copre questo quiz
- Integer division vs floating-point division
- The remainder operator
%with negative numbers - Dividing by zero with
intand withdouble - Prefix and postfix
++ - Short-circuit
&&and+with strings
Domande frequenti
Serve un account?
No. Chiunque può giocare. Accedi per salvare XP, serie, badge e cronologia.
Posso rifarlo?
Sì. Il tuo miglior punteggio resta salvato, e domande e risposte vengono mescolate ogni volta.