Академический Документы
Профессиональный Документы
Культура Документы
INTERFACES
Inheritance
obtain effect of
What is an Interface?
Java does
not permit multiple inheritance from classes,
but permits implementation of multiple
interfaces.
What is an Interface?
By providing the
Why an Interface?
present at
compile time so the Java compiler can check
to ensure that the method signatures are
compatible.
Why an Interface?
Defining Interfaces
Interface is just like any other class but with a major
extended/sub-interfaced from
other interfaces using the
keyword extends.
Extending Interfaces
Interfaces vs Abstract
Classes
Interfaces vs Abstract
Classes.
Interface1_1
Object
Interface2_2
Interface1
Class1
Interface2_1
Class2
keyword extends.
The syntax is the same as for inheriting classes.
When a class implements an interface that
inherits another
interface, it must provide implementations for all
methods
defined within the interface inheritance chain.
Packages
import java.package_name.class_name
THANK YOU!!!