Answer Posted / raga
While creating class objects of which will be immutable. The following
things should be kept in mind:
1. Class should be made final so that no class can extend it.
2. Access modifiers of the instance variables must be private so that no
object can have access to it.
3. There should not be any public set method which can change the state of
the object.
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
Which number is denoted by leading zero in java?
When do we use synchronized methods in java?
FOR EXAMPLE WE R HAVING TWO LIST ELEMENTS ..BOTH LISTS CONTAINS ID,NAME,PLACE ..I NEED TO COMPARE BOTH IDS IN TWO LISTS,IF ID'S R SAME MEANS WE HAVE ADD THE DETAILS(LIKE NAME,PLACE) TO MAP...HOW IS POSSIBLE ?CAN ANY ONE SUGGEST?
How do you take thread dump in java?
What is object of class in java?
Explain java thread life cycle.
How big is a 32 bit integer?
Can each java object keep track of all the threads that want to exclusively access it?
What is the difference between the size and capacity of a vector?
What is meant by flickering?
Write a program to print 15 random numbers using foreach of java 8?
What is a boolean structure?
What is static method with example?
Write a program to print fibonacci series
Can a class extend more than one class?