0% found this document useful (0 votes)
3 views1 page

Java String Quiz

The document is a quiz on Java String methods, featuring questions about specific methods and their functionalities. It covers topics such as character access, string comparison, trimming, replacing characters, case conversion, immutability, and the differences between String, StringBuilder, and StringBuffer. Additionally, it asks about the purpose of the valueOf() method in the String class.

Uploaded by

S.S Verma
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views1 page

Java String Quiz

The document is a quiz on Java String methods, featuring questions about specific methods and their functionalities. It covers topics such as character access, string comparison, trimming, replacing characters, case conversion, immutability, and the differences between String, StringBuilder, and StringBuffer. Additionally, it asks about the purpose of the valueOf() method in the String class.

Uploaded by

S.S Verma
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Java String Methods - Quiz

1. What will be the output of: "Hello".charAt(1)?

2. Which method is used to compare two strings ignoring case?

3. What does the trim() method do?

4. Write the output of: "Java".replace('a', 'o')

5. Which method converts all characters to uppercase?

6. What does equals() method return?

7. Which method splits a string into an array based on a delimiter?

8. Is String mutable in Java? Explain briefly.

9. Difference between String, StringBuilder, and StringBuffer?

10. What is the use of valueOf() method in String class?

You might also like