Multiple inheritance is a feature of some object-oriented computer programming languages in which an object or class can inherit characteristics and features from more than one parent object or parent class.
A large portion of Java software development is using APIs from various libraries. From 10,000 open source Java projects, I extracted the frequency of API classes. The classes are either from Java standard library or from third-party libraries. Each class is counted once for each project. The list below shows the top 100. Continue »
Many Java API classes have methods that return a Collection. Since Java 8, methods can also return a Stream. Since the Stream is more flexible and efficient in many cases, should we return a Steam or Collection for our API methods?
This article illustrates the concepts of inheritance vs. composition in Java. It first shows an example of inheritance, and then shows how to improve the inheritance design by using composition. How to choose between them is summarized at the end.
How to check if an array (unsorted) contains a certain value? This is a very useful and frequently used operation in Java. It is also a top voted question on Stack Overflow. As shown in top voted answers, this can be done in several different ways, but the time complexity could be very different. In the following I will show the time cost of each method.