What is the main difference between creating an object of a class and extending a class.In both the cases we can use the methods and properties of the class which is been extended or made an object

In reply to mamta_r:

Polymorphism means that extended classes can be used in any way that the base class can be used.

When you extend a base ‘bus access sequence’ or a ‘packet transmitted’ base class, to create a more specialized ‘write cycle bus access sequence’ or ‘packet type X transmitted’ class, those new extended classes can be used anywhere that the original base classes can be used.

Read about OOP principles, and try some of your own experiments, it will become clearer.

I edited my answer to add clarification of what I meant by ‘IS an instance’.
You will often see the two types of OOP arrangement I listed - composition and inheritance - described by the phrases “has a” and “is a”. With composition, class_Object HAS A class_Main. With inheritance, class_Extended IS A class_Main.