Java OOP correction