Object oriented programming is a way of writing code such that different objects (instances) are created from a single object…