#coreJava #Interface #seleniumWithJava
What is Interface in Java?
When to use interface class?
▬▬▬▬▬▬ In this Video ▶️ ▬▬▬▬▬▬
Interface:
Interface is nothing but the pure abstract class which contains only abstract method
All methods are default abstract. Means no body definition. Ex: iTestListener
Unable to create an object of interface class.
Unable to use 'final' keyword in interface methods as final will not allow to override but interface needs to override all its methods after implements to child class.
In order to declare an interface the keyword “interface” is used.
Ex: public interface MyInterface{ }
Use implements keyword to inherit interface to child class.
Q: when to use interface class?
A: Since java doesn't allow multiple inheritance in case of concrete class, but using interface it can achieve multiple inheritance.
Interface means set of public methods without body that needs to implement through a sub class. Means when we need specifies set of methods in design without definition so that implementation can be different to each sub-class based on our requirement.
Ex: WebDriver, iTestListener
👉 Enroll on next Automation Batch: https://shorturl.at/0pfFX
▬▬▬▬▬▬ Useful Links 🛠 ▬▬▬▬▬▬
👉 QA Bible ► http://codenboxautomationlab.com/
👉 Agile Manual Testing for beginners ► https://bit.ly/agileTesting
👉 Cypress Automation for beginners ► https://bit.ly/Cypresstutorials
👉 Cypress with BDD framework ► https://bit.ly/Bdd-framework
👉 Cypress with TypeScript ► https://bit.ly/4dRmk8I
👉 Appium mobile automation ► https://bit.ly/4gb9a8h
👉 API Testing with Cypress ► https://bit.ly/Cypress-ApiTesting
👉 API Testing with Postman ► https://bit.ly/Postman-ApiTesting
👉 Java for beginners ► https://bit.ly/3zmHCvT
👉 JavaScript for beginners ► https://bit.ly/3zclLaw
👉 QA Interview Questions & Answers ► https://bit.ly/3AV1YNv
▬▬▬▬▬▬ Connect with us 👋 ▬▬▬▬▬▬
💻 Facebook: / codenboxautomationlab
📱 Twitter: / codenboxteam
📝 LinkedIn: / sarifuli
🌟 Please hit on LIKE ❤️ and SUBSCRIBE for more AMAZING content! 🌟