They allow polymorphism, where derived classes can provide different behavior for the same function calls.
For example, a Shape class can have a virtual getArea () method.
Derived classes (like Circle, Square, etc...) will provide different implementations of getArea (), which use different formulas for the area calculation. Thus, you can call getArea () on a Shape object, regardless of which concrete derived class it represents, and you'll get the correct area.
<pre lang="text">Thanks a lot <b>Alan </b> I tried the following code. It is giving me the title of every open windows. But I want only the exception popup window( i.e. error windows generated from other applications) from them.How could I get this. Plz help me.</pre>