- 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: Strings & String Methods
This Java strings quiz tests the String methods you use every day and the traps around them. You will predict the output of substring, indexOf and split, compare strings the right way and see why strings never change in place.
Domanda di esempio
Domanda 1 di 10What does this print?
public class Main {
public static void main(String[] args) {
String s = "Hello";
s.toUpperCase();
System.out.println(s);
}
}
Mostra la risposta
B. Hello Strings are immutable: toUpperCase() returns a new string and leaves s alone. The result is thrown away here; write s = s.toUpperCase(); to keep it.
Cosa copre questo quiz
- Strings are immutable
==vsequals()andequalsIgnoreCase()substring,indexOf,charAtand their index rulessplitand empty trailing strings- Concatenating
nulland usingStringBuilder
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.