Why are we using abstract class and interface ?
Answers to your questions:
1: No, we cannot create the object of Interface as well as Abstract Class.
In the case of Interface, we need to create an implementing class which implements all the methods specified by the Interface. The object of that class can be created and can be used.
In the case of Abstract class, we need to create an extending class which implements all the remaining methods specified by the Interface. After that, we can create the object of the extending class.
2: These concepts are useful in automation as interface provides the basic frame to the code which needs to be described by each implementing class. In the case of Abstract class, this tells us that few things are implemented and few are remaining which needs to be completed. For example, two classes share the same piece of code. In that case, we can make use of the abstract class to implement those and can describe the remaining methods.
We offer online selenium and UFT/QTP training. The course is very comprehensive and covers every aspect of automation testing with UFT/QTP and selenium. All types of frameworks are covered in depth - data driven framework, hybrid framework, page object model with a live project
© 2020 Whizdom Trainings. All rights Reserved - Powered by Whizdom Trainings