I didnt get the use of AbstractFactory class there. What advantage we got when the Factories are of AbstractFactory type.
When your system has to create multiple families of products or you want to provide a library of products without exposing the implementation details, you can use this pattern.
A key characteristic of this pattern : It will decouple the concrete classes from the client.
Refer to this below SE question for more details:
What is the basic difference between the Factory and Abstract Factory Patterns?
An example of an Abstract Factory in use could be UI tool kits ( Across Windows, Mac and Linux
).
However, the implementation of these widgets vary across platforms. You could write a platform independent client thanks to the Abstract Factory implementation.
Moreover why to use class there? we can go for an Interface right?
Interface can't achieve the intent of Abstract Factory pattern. With interfaces, client need to know the contract. Any changes in contract are visible to client and these changes may break client functionality. But Abstract Factory decouple client from concrete classes, which are implementing the interface ( Factory Method)
Below articles are useful for better understanding
dzone article
oodesign article
sourcemaking article