Instructor
Ashish Thakur Replied on 07/08/2019
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.