Top "Effective-java" questions

Effective Java is a book by Joshua Bloch "designed to help Java programmers make the most effective use of the Java programming language and its fundamental libraries"

What is an AssertionError? In which case should I throw it from my own code?

In Item 2 of the "Effective Java, 2nd edition" book, there is this snippet of code, in which the author wants …

java exception effective-java
Java Model Objects design

So I've been reading some Effective Java! And one of the most inspiring sections of the book is the Immutable …

java object model effective-java
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 …

java serialization effective-java
Why are public static final array a security hole?

Effective java says: // Potential security hole! static public final Thing[] VALUES = { ... }; Can somebody tell me what is the security hole?

java effective-java
What is the difference between a compile time type vs run time type for any object in Java?

What is the difference between compile time and run time type of any object in Java ? I am reading Effective …

java generics effective-java
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. Quote[Bloch, …

java design-patterns factory effective-java
Builder pattern validation - Effective Java

In Item 2 of Effective Java (2nd Edition), the author mentions the following about imposing invariants on parameters while using Builders: …

java design-patterns builder effective-java
Do we need a .build() method in the Builder Pattern?

I had a question regarding the "Builder Pattern" covered in "Effective Java". Do we need a .build() method for it …

java design-patterns builder effective-java
how caching hashcode works in Java as suggested by Joshua Bloch in effective java?

I have the following piece of code from effective java by Joshua Bloch (Item 9, chapter 3, page 49) If a class is …

java caching hashcode effective-java