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 main function is static?
Why is an interface be able to extend more than one interface but a class can’t extend more than one class?
What is a byte string?
what do you understand by the term string with respect to java?
perpare on factorypattern,linklist wothout using collection, (multitharding ie create producer/customer therad producer create Queue continuesly,consumer consume queue, consumer wait if queue is full,producer wait if queue is empty),diff betn sleep(1000)&wait(1000) these r the main Q ask in huawei(2008)
Why char array is favored over string for the storage of passwords?
What are the benefits of operations in java?
Explain jdk, jre and jvm?
What is meant by final class?
What is the difference between equals() and == in java?
why string is not taking as primitive datatypes but we r taking it as a class? why explain it?
Explain implementation and how is it different from conversion?