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 |
WHAT IS THE MEANING OF ALL TYPE OF BUZZWORDS?
What is the relationship between a method?s throws clause and the exceptions that can be thrown during the method?s execution?
How can you debug the Java code?
What is the difference between stringbuffer and stringbuilder?
Can an object subclass another object?
How do you differentiate abstract class from interface?
java is pure object-oriented programming language?why it is platform independent.
What do you understand by casting in java language?
What is a reflection package?
Are arrays immutable in java?
What are the three best choices for a development environment?
What is a heavyweight component?