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 |
java program with complete 4 oops concepts implemented example
i need to know the website that i can compile and run a java code in online.(while system doesn't contain any jdk and jre)
what is heap memory?
0 Answers Tavant Technologies, Zensar,
Why we override equals() method?
What are the five major types of reference sources?
How do you sort a string in alphabetical order in java?
What is api in java?
How to create a custom exception?
When is an object in the mean to garbage collection?
What are green threads in java?
Can variables be used in java without initialization?
what is the output ? Math.floor(-2.1) a)2 b)-2 c)-3.0 d)0