difference between abstract vs interface

Interfaces specify what a class must do. 
It is the blueprint of the class.
It is used to achieve total abstraction. 
We are using implements keyword for interface.

Basic statement we all know in Selenium is
WebDriver driver = new FirefoxDriver();
WebDriver itself is an Interface.
So we are initializing Firefox browser
using Selenium WebDriver.
It means we are creating a reference variable
of the interface and creating an Object.
So WebDriver is an Interface and
FirefoxDriver is a class.

Sometimes we may come across a situation
where we cannot provide implementation to
all the methods in a class. We want to leave the 
implementation to a class that extends it.
  In that case we declare a class
as abstract by using abstract keyword on method
signature.In my framework I have created my
PageBase class as super
class of the all page classes. 
I have collected all common elements
and functions into PageBase class and
all other page classes extent PageBase class.
By doing so, I don't have to locate very
common WebElements and it provides
reusability in my framework.

Also
1)Abstract classes cannot be instantiated
2)An abstarct classes contains abstract method,
concrete methods or both.
3)Any class which extends abstarct class must
  override all methods of abstract class
4)An abstarct class can contain either
  0 or more abstract method.  

Are there any code examples left?
Create a Free Account
Unlock the power of data and AI by diving into Python, ChatGPT, SQL, Power BI, and beyond.
Sign up
Develop soft skills on BrainApps
Complete the IQ Test
Relative searches
what is the difference between abstract classes and interfaces difference between abstract class and interfaces difference between interface and abstract in java abstract classes vs interface interface vs abstract class with example whats the difference between abstract and intriduction diff between abstract class and interface What's the difference between an Abstract class and interface? What is difference between interface and abstract class differnet betwen abstract and interface difference interface and an abstract What is the difference between an abstract class and an interface and when should you use them? trait vs interface vs abstract class Similarities and differences between interfaces and abstract functions What are differences between abstract classes and interfaces difference between abstract class and interface in typescript interface and abstract class difference difference between interfaces and abstract classes What is the difference between Abstract class and Interface? java interface vs abstract difference between abstract and interface class interfaces vs abstract classes What is the main difference between an abstract class and an interface? what is the main difference between abstract class and interface abstract method vs interface abstract class and interface difference Difference between abstract class and interface in Java? Differentiate between interface and abstract class difference between abstract class and interface java interface class vs abstract class difference between interface vs abstract class typescript abstract and interface difference when to use an interface vs abstract class difference between interface and abstract class in java what is the difference between interface and abstract class abstract class vs interfaces What is the difference between an abstract class and an interface? what's the difference between abstract and interface difference between abstract class and interface in java interface vs an abstract class What is the difference between Interface and Abstract Class differnce between abstract and interface the difference between interface and abstract class java interface vs abstract class when to use abstract class vs interface what is the difference between abstract class and interface difference in abstract class and interface difference between interface and abstract class java What is the difference between an Interface and an Abstract class? abstract and interface difference in java abstract vs interface java difference between interface and abstract class Diff between interface and abstract class when to use an abstract class vs interface What is the difference between Abstract classes and interface? difference between interference and abstract class interface vs abstract interface vs abstract class what is the difference between abstract and interface difference between interface and abstract class difference between abstract class and interface difference between abstract and interface abstract class vs interface when to use interface vs abstract class abstract class vs interface when to use what is the diffrence between abstract class and interface difference between abstract vs interface
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source