How to make a class immutable?

Answer Posted / teja

dont provider setters and provide the parameter constructor

Is This Answer Correct ?    10 Yes 27 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

This abstract class is correct ? abstract class A { public abstract void Disp(); public abstract void B() { } public absract virtual C() { } }

557


Is null a string?

550


What is the difference between an if statement and a switch statement?

648


What is string in java is it a data type?

531


What is static method with example?

614






If goto and const is reserve words than why it is not work in java?

1504


What are the advantages of exception handling?

550


Can an interface have a class?

561


In how many ways we can do exception handling in java?

573


What is an empty string in css?

523


Is singleton class thread safe?

531


what is meant by HQL?

639


Does variable declaration allocate memory?

581


How to reverse a string in java?

520


What are void methods?

568