You are on page 1of 1

Java String Interview Questions

1. What �string� classes do you know?


2. What are the main properties of �string� classes (their features)?
3. Is it possible to inherit a string type, why?
4. Define the concept of string concatenation.
5. How to convert a string to a number?
6. How to compare the value of two lines?
7. How to flip a string?
8. How does the comparison of two lines work?
9. How to trim spaces at the end of a line?
10. How to replace a character in a string?
11. How to get part of the line?
12. Define the concept of �string pool�.
13. What method allows you to select a substring in a string?
14. How to split a string into substrings for a given delimiter?
15. What method is called to convert a variable to a string?
16. How to know the value of a specific character of a string, knowing its ordinal
number in a string?
17. How to find the required character in the string?
18. Is it possible to synchronize access to the string?
19. What does the intern () method do?
20. What is the difference and what does the String, StringBuffer and StringBuilder
classes have in common?
21. How to compare the string values ??of two different objects of type String and
StringBuffer?
22. Why is the string unchanged and finalized in Java?
23. Why an array of characters is preferable to the string to store the password?
24. Why is string a popular key in a HashMap in Java?
25. Write a method to remove this character from the string.

You might also like