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 |
Why is a singleton bad?
Can one thread block the other thread?
Is a class an object?
Why call by value prevents parameter value change?
What are the advantages of the model over the event- inheritance model?
Explain about main() method in java ?
How can we achieve IPC in JAVA?
What is a get method?
How many types of voids are there?
What are features of java?
What is not thread safe?
how can we import the user defined package without classpath?