Favor composition over inheritance is a one of the popular object oriented design principle, which helps to create flexible and maintainable code in Java and other object oriented languages. Many times I have seen people suggesting use composition instead of inheritance, in fact my favorite books like Head first Design Patterns, also advocates this design principle. Head first books, has its own way of explaining, why composition is better than inheritance and though its long its quite interesting and informative. It was the first chapter of this book, which helped me a lot on understanding this key OOPS concept. In this Java and OOPS tutorial, I have tried to summarize my experience around composition and inheritance in two main category, first, difference between composition and inheritance and second, when to use Composition over inheritance in Java. I have already mentioned about this design principle, in my list of 10 OOPS and SOLID design principles for Java programmers, here we will take a more closer look.