Why are the objects immutable in java?
Answer / Viresh Kumar
"Immutable objects offer several advantages such as thread safety, predictability, and security. By making an object immutable, you ensure that its state will not be modified after it's created, thus eliminating the possibility of inconsistent or unpredictable behavior."
| Is This Answer Correct ? | 0 Yes | 0 No |
Marker interface means , interface which has no methods.Then what is the necessity of its usage.I read "it tells the compiler that it should be treated differently ". "It is used to store state of an object". But still am not clear.Please explain clearly.
What do you understand by java virtual machine?
when to use ArrayList and when to use HashMap in webApplication.
What are different types of arrays?
Why are constructors used?
Explain spliterator in java8?
How to create two different thread class inside a main function?
What are adapter classes?
What is api data?
Is final static java?
What is the use of static import ?
Does any tag exists in HTML to upload and download files ?