I read about mutable / immutable objects. Immutable objects have many useful properties. But it is possible to distinguish two that are characteristic of practically all immutable objects:
1) Immutable objects can be implemented much easier than mutable ones. 2) Immutable objects can be freely used simultaneously from different threads.
I have a few questions, please ask if you answer and it’s not difficult for you to answer me point by point, thanks in advance :)
1) How to understand objects can be implemented much easier?
2) Correct information or not? - An immutable object is an object whose external visible state cannot change after its creation. The String, Integer, and BigDecimal classes in the Java class library are examples of immutable objects — they represent a separate value that cannot change during the object's life cycle.
3) What are mutable / immutable objects besides classes String (StringBuilder, StringBuffer), Integer, BigDecimal? Just the names I want to see.
4) Immutable objects can be freely used simultaneously from different threads. Threads it flows? Are they synonymous?