It might be difficult to read, but it is a really good book.
Carlos Reves wrote:. . . this book Effective Java (2nd Edition) by Joshua Bloch.
That may be a bit of an exaggeration. Bloch points out that factory methods have advantages, and constructors have disadvantages under some circumstances, but he doesn't actually say to prefer factory methods over constructors. At least I don't think so. In the present instance there is no need to abandon public constructors.
. . . he prefers static factory methods instead of constructors.
Thanks Knute. Appreciate!
Knute Snortum wrote:Cows for a great job fixing your code and adding to the test suite.
Ok... Didn't know that. Will take a look.
Knute Snortum wrote:A note about calling methods from constructors. Any method you call from a constructor should be marked final. This is because if the method gets overridden it could cause strange behaviors in your constructor.
I have an account on GitHub. If i upload there my code i can post the links to it here? I'm almost done for now. But already made the divide() and remainder() methods also. And added tests for them in the suite (all went well).
Knute Snortum wrote:I don't have your new add() and subtract() methods, so I'm still getting errors in them, and I don't have multiply(). Do you want to keep posting here, or are you satisfied? In a real work environment we would be posting to some sort of versioning software like git. You can do this easily with github.com for free.
You're right. I used it in an earlier version but now it's not used at all. Forgot to delete. Done...
Knute Snortum wrote:In the method validateString(), this line seem to do nothing:
I have an account on GitHub. If i upload there my code i can post the links to it here?
Wow! That's great! Thanks for the journal entry and for the cow!
Frits Walraven wrote:Congratulations your question has made it to our CodeRanch Journal - February 2017
Have a Cow!