- 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: ArrayList
This Java quiz covers ArrayList, the list you will use most. You will predict what add(), set(), remove() and indexOf() do, see why List.of() refuses changes and learn which operations are fast.
Domanda di esempio
Domanda 1 di 10What does this print?
import java.util.ArrayList;
import java.util.List;
public class Main {
public static void main(String[] args) {
List<String> list = new ArrayList<>();
list.add("a");
list.add("b");
list.add(0, "c");
System.out.println(list);
}
}
Mostra la risposta
B. [c, a, b] add(x) appends at the end, but add(0, x) inserts at index 0 and shifts the others right. So c ends up first.
Cosa copre questo quiz
add(),add(index, x)andset()get(),indexOf()andlastIndexOf()remove(Object)and out-of-range indexesList.of()andArrays.asList()limits- Generics need wrapper types like
Integer
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.