14. Java Basics for Selenium - Java Interfaces
Автор: subbus tech
Загружено: 2019-03-12
Просмотров: 35
Описание:
Abstract class is used for partial abstraction. Interface is used for full abstraction.
Abstraction is a process where you show only relevant data and hide unnecessary details of an object from the user.
Interface looks like a class but it is not a class. An interface can have methods and variables just like the class but the methods declared in interface are by default abstract (only method signature, no body). Also, the variables declared in an interface are public, static & final by default.
Since methods in interfaces do not have body, they have to be implemented by the class before you can access them. The class that implements interface must implement all the methods of that interface. Also, java programming language does not allow you to extend more than one class, However, you can implement more than one interfaces in your class.
Syntax:
interface DemoInterface{
public void testmethod1();
public void testmethod2();
}
An interface cannot implement another interface. It has to extend another interface.
Повторяем попытку...
Доступные форматы для скачивания:
Скачать видео
-
Информация по загрузке: