Why is String a class in Java ?
Javasearch.buggybread.com

Search Interview Questions


 More than 3000 questions in repository.
 There are more than 900 unanswered questions.
Click here and help us by providing the answer.
 Have a video suggestion.
Click Correct / Improve and please let us know.
Label / Company      Label / Company / Text

   



Interview Questions and Answers

 Q1. Why is String a class in Java ?Core Java
Ans. 1. Creating a class helps in specifying operations on the Strings like length , sub string , concatenation etc.

2. It acts as a Wrapper class for "Array of Characters" and hence facilitates it's usage in collections, assignment to null.

3. Immutability of String objects facilitates in reuse , security and caching.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     string class


Related Questions

  Why is String immutable in Java ?
  Explain the scenerios to choose between String , StringBuilder and StringBuffer ?

or

What is the difference between String , StringBuilder and StringBuffer ?
  Why Char array is preferred over String for storing password?
  What are different ways to create String Object? Explain.
  What is a String Pool ?
  Which String class does not override the equals() and hashCode() methods, inheriting them directly from class Object?
  What is the difference between StringBuffer and String class ?
  What is an immutable class ?
  Difference between StringBuffer and StringBuilder ?
  What does String intern() method do?



Help us and Others Improve. Please let us know the questions asked in any of your previous interview.

Any input from you will be highly appreciated and It will unlock the application for 10 more requests.

Company Name:
Questions Asked: