why string is not taking as primitive datatypes but we r
taking it as a class? why explain it?
Answers were Sorted based on User's Feedback
Answer / ankit
All primitive types have fixed memory size. Now in case of
the String, its length is not fixed and so is its size.
That's why it cannot be a primitive data type.
| Is This Answer Correct ? | 5 Yes | 2 No |
Answer / payel
String should be class so that it can be immutable and
making String immutable, makes it thread safe and
thus imporves performance.
| Is This Answer Correct ? | 2 Yes | 2 No |
Explain about class in java?
How can u increase the heap size in the memory?
Can we have multiple classes in a single file?
What is a "pure virtual" member function?
What is private public protected in java?
How to know the host from which Applet is originated?
Is string a class?
How many wrapper classes are there in java?
What is meant by packages?
What is math floor in java?
Is java good for beginners?
Can we override a variable in java?