Update index.md (#26358)

* Update index.md

Added statements to visualize interfaces differently.

* Formatting changes
This commit is contained in:
Raymart Evangelista
2018-12-26 15:26:34 -08:00
committed by Manish Giri
parent 0e86226911
commit f9f816514c

View File

@ -3,7 +3,11 @@ title: Interfaces
---
# Interfaces
Interface in Java is a bit like the Class, but with a significant difference : an `interface` can _only_ have method signatures, fields and default methods. Since Java 8, you can also create [default methods](https://docs.oracle.com/javase/tutorial/java/IandI/defaultmethods.html). In the next block you can see an example of interface :
Interface in Java is a bit like the Class, but with a significant difference : an `interface` can _only_ have method signatures, fields and default methods. Since Java 8, you can also create [default methods](https://docs.oracle.com/javase/tutorial/java/IandI/defaultmethods.html).
Classes that implement an interface are thought to be signing a contract and agreeing to perform the specific behaviors listed in the interface. If the classes that implement an interface do not implement all the methods of the interface, then such a class needs to be defined as `abstract`.
In the next block you can see an example of interface :
```java
public interface Vehicle {