OOP Demo written in java