A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://www.geeksforgeeks.org/quizzes/java-string-classes/ below:

Quiz about Java String Classes

Which of the following is immutable in Java?

What is the key difference between StringBuffer and StringBuilder?

Which of the following will compile successfully?

Java
StringBuffer sb = "Hello";

Which class should be used when multiple threads need to modify the same string?

What will be the output of the following code?

Java
String s1 = "Java";
String s2 = s1.concat(" Programming");
System.out.println(s1);

Which of the following methods exists in StringBuffer but not in String?

What will be the output of the following code?

Java
StringBuilder sb = new StringBuilder("Hello");
sb.append(" World");
System.out.println(sb);

Which is the fastest for string modifications in a single-threaded environment?

What happens if multiple threads try to modify a StringBuilder instance?

What will be the output of the following code?

Java
StringBuffer sb1 = new StringBuffer("Java");
StringBuffer sb2 = sb1;
sb1.append(" Programming");
System.out.println(sb2);

There are 10 questions to complete.

Take a part in the ongoing discussion


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4