Solid Principle With Example Java