How to create toString() method in Java?

In this post, I am sharing several ways of creating toString method in Java. The toString() method returns a string representation of the object. Before we move on, there are a few questions that you should answer first. The main question would be whether a custom toString() implementation is really needed or we can use the default Java Object.toString() one. Another one would be about the best format of the string representation of the object.
Read full post

Clock angle problem in Java

Explanation and a detailed solution to a frequently asked interview question regarding the clock angle problem. Presented implementation in Java.