From ea60e15e1c5633b9501c040ad5015cbbceea19ca Mon Sep 17 00:00:00 2001 From: Charan Sai Date: Tue, 14 Sep 2021 09:00:50 +0530 Subject: [PATCH] Update in `Consider static factory methods instead of constructors` A typo in `Consider static factory methods instead of constructors` Advantages. --- books/effective-java.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/books/effective-java.md b/books/effective-java.md index 56ef36e..777663c 100644 --- a/books/effective-java.md +++ b/books/effective-java.md @@ -27,7 +27,7 @@ Advantages: * They are not required to create a new object each time they are invoked. * They can return an object of any subtype of their return type. * The class of the returned object can vary from call to call as a function of the input parameters. -* The class of the returned object need to exist when the class containing the method is written. +* The class of the returned object need not to exist when the class containing the method is written. Disadvantages: * Classes that provide only static factory methods without public or protected constructors cannot be subclassed. This is preferable when using composition instead of inheritance.