About 50 results
Open links in new tab
  1. java - Immutable class? - Stack Overflow

    Jul 2, 2010 · How can one make a Java class immutable, what is the need of immutability and is there any advantage to using this?

  2. How to create immutable class in java - Stack Overflow

    Dec 25, 2013 · How can create immutable class in java. if Student class has a relationship (address) how to create immutable class. I want to make the class below immutable final public class Student {

  3. How to create immutable objects in Java? - Stack Overflow

    Jun 10, 2011 · How to create immutable objects in Java? Which objects should be called immutable? If I have class with all static members is it immutable?

  4. immutability - Make immutable Java object - Stack Overflow

    Here are few rules, which helps to make a class immutable in Java : 1. State of immutable object can not be modified after construction, any modification should result in new immutable object.

  5. java - Examples of immutable classes - Stack Overflow

    Feb 25, 2011 · I already know the definition of immutable classes but I need a few examples.

  6. How to make an immutable class in Java? - Stack Overflow

    May 9, 2018 · I came across this exercise online where I have two classes and I'm supposed to make the Tutor class immutable. However, the only thing I can think of is adding final to name field. When …

  7. How to create an immutable class in Java without using final keyword

    Mar 23, 2011 · Possible Duplicate: Implement a final class without the “final” keyword I want to create an immutable class in Java without using the final keyword.

  8. java - How can we maintain Immutability of a class with a mutable ...

    A thread-safe immutable object is seen as immutable by all threads, even if a data race is used to pass references to the immutable object between threads. This can provide safety guarantees against …

  9. java - Why do we need immutable class? - Stack Overflow

    The Java platform libraries contain many immutable classes, including String, the boxed primitive classes, and BigInte- ger and BigDecimal. There are many good reasons for this: Immutable classes …

  10. How to make a class immutable in java with date field in it?

    Aug 6, 2015 · I have created an immutable class with a date field. How do I ensure that even the date field is immutable, since even if you make date field final you can still assign a different value to it later?