effective-java
Immutable in java
In Effective Java, Bloch recommends to make all the fields final in making an object immutable . Is it necessary to do so ? Won\'t just not giving accessor methods make it immutable.[详细]
2023-04-09 02:44 分类:问答Using auto generated id of Hibernate entity object in the equals and hashcode methods
Lovely equals and hashcode, all the theory is here and also here I have taken the decision to use the auto-generated id within equals() and hashcode() in a number of my hibernate entity/domain object[详细]
2023-04-08 17:57 分类:问答Example of an elegant implementation of 'Defensive Copying' of a nullable java.util.Date in a JavaBean's getter/setter implementation?
Is there an elegant Java implementation of Joshua Bloch\'s defensive copying techniques using the example b开发者_StackOverflowelow?The nullChecking is really the issue I think, but perhaps there is a[详细]
2023-04-07 12:15 分类:问答Item 9 (equals contract) from Effective Java: is the example correct?
Bloch\'s wonderful book \"Effective Java\" points out that if equals is not symmetric then the behavior of Collections contains is indeterminate.[详细]
2023-04-06 22:21 分类:问答Why are readObject and writeObject private, and why would I write transient variables explicitly?
I am reading the chapter on Serialization in Effective Java. Who calls the readObject() and writeObject()? Why are these methods declared private ?[详细]
2023-04-06 06:58 分类:问答nested static builder class, further explanation on its plumbing
public class MyPojo{ String required; Integer optionalOne; Integer optionalTwo; private MyPojo(Builder builder){[详细]
2023-04-05 12:12 分类:问答What is a nonmemory resource?
I am reading \"Effective Java\". In the discussion about fi开发者_Python百科nalize, he says C++ destructors are also used to reclaim other nonmemory resources.[详细]
2023-03-27 20:44 分类:问答classes managing own memory
Effective Java: Item 6: Eliminate obsolete object references. Generally speaking, whenever a class manages its own memory, the programmer[详细]
2023-03-09 21:18 分类:问答Effective Java By Joshua Bloch: Item1 - Static Factory Method
I am reading the Effective Java by Joshua Bloch and I have question about Item1 Static Factory Method.[详细]
2023-03-08 04:24 分类:问答Is this class fully Immutable?
I am trying to convert a mutable class to an Immutable class following the advices given in Effective Java Item 15 (Minimize Mutability). Can anybody tell me whether the class I created is[详细]
2023-01-08 23:36 分类:问答