How do you make a class immutable in java?
Answer / Ravi Ranjan
To make a class immutable in Java, make its fields final (to ensure they cannot be modified), ensure the constructor is private, and provide factory methods for creating instances.
| Is This Answer Correct ? | 0 Yes | 0 No |
Which one should we prefer while using bean ? managed bean annotation or faces-config
Is java safe to download?
What is distributed application?
What is component-managed sign-on ?
What is application client module?
why we are using XML?
What is ejb container provider?
whay java does not support bass by reference
What is wildfly java?
What is considered as a web component?
What is j2ee product provider?
What is java 2 platform, micro edition (j2me)?