{"id":2275,"date":"2026-01-07T06:12:26","date_gmt":"2026-01-07T11:12:26","guid":{"rendered":"https:\/\/www.h2kinfosys.com\/blog\/?p=2275"},"modified":"2026-01-07T06:12:29","modified_gmt":"2026-01-07T11:12:29","slug":"interfaces-abstract-classes","status":"publish","type":"post","link":"https:\/\/www.h2kinfosys.com\/blog\/interfaces-abstract-classes\/","title":{"rendered":"Interfaces and Abstract classes"},"content":{"rendered":"<h2><b>Abstract classes<\/b><\/h2>\n<p>In <a href=\"https:\/\/www.h2kinfosys.com\/blog\/what-is-java\/\">Java language<\/a>, which is covered extensively in a <a href=\"https:\/\/www.h2kinfosys.com\/courses\/java-online-training-course-details\/\">java full stack developer course<\/a>, an abstract class is a class that cannot be instantiated and may or may not contain abstract methods. Both abstract classes and methods are marked with the abstract keyword. Here is an example:<\/p>\n<p dir=\"ltr\" style=\"line-height: 1.2; margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">public abstract<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">class<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0Animal {<\/span><\/p>\n<p dir=\"ltr\" style=\"line-height: 1.2; margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: #ffffff; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #3f7f5f; background-color: #ffffff; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\/\/ declare fields<\/span><\/p>\n<p dir=\"ltr\" style=\"line-height: 1.2; margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">public<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0String\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #0000c0; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">color<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">;<\/span><\/p>\n<p dir=\"ltr\" style=\"line-height: 1.2; margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: #ffffff; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #3f7f5f; background-color: #ffffff; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\/\/declare non-abstract methods<\/span><\/p>\n<p dir=\"ltr\" style=\"line-height: 1.2; margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">public<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0String getColor() {<\/span><\/p>\n<p dir=\"ltr\" style=\"line-height: 1.2; margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">return<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #0000c0; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">color<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">;<\/span><\/p>\n<p dir=\"ltr\" style=\"line-height: 1.2; margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">}<\/span><\/p>\n<p dir=\"ltr\" style=\"line-height: 1.2; margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">public<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">abstract<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">void<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0walk();<\/span><\/p>\n<p dir=\"ltr\" style=\"line-height: 1.2; margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">}<\/span><\/p>\n<p><span style=\"font-weight: 400;\">As you can see, an abstract method is a method definition without braces and followed by a semicolon. It does not have an implementation. This code doesn&#8217;t compile:<\/span><\/p>\n<p dir=\"ltr\" style=\"line-height: 1.2; margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">public abstract class<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0Chicken {<\/span><\/p>\n<p dir=\"ltr\" style=\"line-height: 1.2; margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">public<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">abstract<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">void<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0peck() {};\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #3f7f5f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\/\/ DOES NOT COMPILE<\/span><\/p>\n<p dir=\"ltr\" style=\"line-height: 1.2; margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">}<\/span><\/p>\n<p><span style=\"font-weight: 400;\">If you want to have default implementation of a method in your abstract class, you have to use non-abstract methods.<br \/>\n<\/span><span style=\"font-weight: 400;\">Nonabstract classes cannot contain abstract methods. This code does not compile:<\/span><\/p>\n<p dir=\"ltr\" style=\"line-height: 1.2; margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">public<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">class<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0Chicken {<\/span><\/p>\n<p dir=\"ltr\" style=\"line-height: 1.2; margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">public<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">abstract<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">void<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0peck();\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #3f7f5f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\/\/ DOES NOT COMPILE<\/span><\/p>\n<p dir=\"ltr\" style=\"line-height: 1.2; margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">}<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Abstract classes cannot be instantiated, but we can create a subclass of them. <a href=\"https:\/\/www.h2kinfosys.com\/blog\/design-a-class-in-java\/\">Subclasses <\/a>usually provide an implementation for the abstract methods of the superclass. If they don&#8217;t provide implementation, then they have to be declared also as abstract:<\/span><\/p>\n<p dir=\"ltr\" style=\"line-height: 1.2; margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">public abstract<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">class<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0Mammal\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">extends<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0Animal {<\/span><\/p>\n<p dir=\"ltr\" style=\"line-height: 1.2; margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">public<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">abstract<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">void<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0walk();<\/span><\/p>\n<p dir=\"ltr\" style=\"line-height: 1.2; margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">}<\/span><\/p>\n<p dir=\"ltr\" style=\"line-height: 1.2; margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">public class<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0Cat\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">extends<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0Mammal {<\/span><\/p>\n<p dir=\"ltr\" style=\"line-height: 1.2; margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">public<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">void<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0walk() {<\/span><\/p>\n<p dir=\"ltr\" style=\"line-height: 1.2; margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">System.<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #0000c0; background-color: transparent; font-weight: bold; font-style: italic; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">out<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">.println(<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #2a00ff; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">&#8220;The cat uses 4 four limbs for a walk&#8221;<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">);<\/span><\/p>\n<p dir=\"ltr\" style=\"line-height: 1.2; margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">};<\/span><\/p>\n<p dir=\"ltr\" style=\"line-height: 1.2; margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">}<\/span><\/p>\n<p><span style=\"font-weight: 400;\">In abstract classes, you can declare fields with or without static and final modifiers. And concrete methods can be not just public, but also default, protected or private.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Abstract classes cannot have modifier final. The reason is obvious. Abstract classes are created to be extended by subclasses. The modifier final prohibit class to have subclasses. The following code doesn&#8217;t compile:<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">public<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">final<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">abstract<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">class<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: underline; -webkit-text-decoration-skip: none; text-decoration-skip-ink: none; vertical-align: baseline; white-space: pre-wrap;\">Tortoise<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0{\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #3f7f5f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\/\/ DOES NOT COMPILE<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">}<\/span><\/p>\n<p><span style=\"font-weight: 400;\">For the same reason, abstract methods cannot be marked as final. For the same reason, abstract methods cannot be marked as final. Let&#8217;s assume that you use modifier final for method. Not it cannot be overridden in subclasses. Therefore, subclasses cannot be concrete. They will be abstract and cannot be instantiated. This code does not compile:<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">public<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">abstract<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">class<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0Cat {<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">public<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">abstract<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">final<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">void<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0meow();\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #3f7f5f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\/\/ DOES NOT COMPILE<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">}<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Also, abstract methods cannot be private. Think a bit and you will understand the reason. Abstract private methods cannot be accessed from another class. Consequently, subclasses of your abstract class that has a private method cannot see it and override it cannot override it. So, this rule makes sense. An example:<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">public<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">abstract<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">class<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0Animal {<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">private<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">abstract<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">void<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0run();\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #3f7f5f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\/\/ DOES NOT COMPILE<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">}<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">public<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">class<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0Panther\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">extends<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0Animal {<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">private<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">void<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0run() {<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">System.<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #0000c0; background-color: transparent; font-weight: bold; font-style: italic; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">out<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">.println(<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #2a00ff; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">&#8220;Animal is running&#8221;<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">);<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0}<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">}<\/span><\/p>\n<p><span style=\"font-weight: 400;\">The method run() from the class Animal is not visible for the class Panther. This means, that the method would be not be overridden by the method run() of the class Panther. The method run() form Animal is unreachable from all classes, except its own class.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Let&#8217;s try to change the methods modifiers to protected:<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">public<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">abstract<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">class<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0Animal {<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">protected<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">abstract<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">void<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0run();\u00a0<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">}<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">public<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">class<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0Panther\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">extends<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0Animal {<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">protected<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">void<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0run() {<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">System.<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #0000c0; background-color: transparent; font-weight: bold; font-style: italic; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">out<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">.println(<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #2a00ff; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">&#8220;Animal is running&#8221;<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">);<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0}<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">}<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Now, this code will work.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">It is important to remember that non-abstract subclasses have to implement all the abstract methods of the abstract superclass. You can extend an abstract class with another abstract class:<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">public<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">abstract<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">class<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: underline; -webkit-text-decoration-skip: none; text-decoration-skip-ink: none; vertical-align: baseline; white-space: pre-wrap;\">Animal<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0{<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">public<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">abstract<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0String getName();<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">}<\/span><\/p>\n<p style=\"padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">public<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">class<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: underline; -webkit-text-decoration-skip: none; text-decoration-skip-ink: none; vertical-align: baseline; white-space: pre-wrap;\">Monkey<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">extends<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0Animal {\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #3f7f5f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\/\/ DOES NOT COMPILE<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">}<\/span><\/p>\n<p style=\"padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">public<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">abstract<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">class<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: #c0c0c0; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: underline; -webkit-text-decoration-skip: none; text-decoration-skip-ink: none; vertical-align: baseline; white-space: pre-wrap;\">Dog<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">extends<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0Animal {<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">}<\/span><\/p>\n<h2><b>Interfaces<\/b><\/h2>\n<p><span style=\"font-weight: 400;\">An interface is one of the ways to achieve abstraction in Java language. It can have fields method declarations and methods, but cannot be instantiated. Here is an example of interface:<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">interface<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0Animal {<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">void<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0run();\u00a0<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 12pt; font-family: 'Times New Roman'; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">}<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Usually, it does not make sense to have variables in interfaces. More practically is to include constants.\u00a0 All fields in an interface are public, even without the use of the access modifier:<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">interface<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0Animal {<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">public<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">static<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">final<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0String\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #0000c0; background-color: transparent; font-weight: bold; font-style: italic; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">name<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0=\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #2a00ff; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">&#8220;Wiki&#8221;<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">;<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">public<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0String\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #0000c0; background-color: transparent; font-weight: bold; font-style: italic; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">color<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0=\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #2a00ff; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">&#8220;white&#8221;<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">;<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt;\"><span style=\"font-size: 12pt; font-family: 'Times New Roman'; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">}<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Interfaces contain declarations of methods. After JDK 8, there is a possibility to include methods with implementation, they have to be static or default. After JDK 9,\u00a0 methods in interfaces can be also private. For example:<\/span><\/p>\n<p><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">interface<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0Animal {<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">default<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">void<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0run() {<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">jump();<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">System.<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #0000c0; background-color: transparent; font-weight: bold; font-style: italic; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">out<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">.println(<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #2a00ff; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">&#8220;Animal is running!&#8221;<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">);<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">}<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">private<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">void<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0jump() {<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">System.<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #0000c0; background-color: transparent; font-weight: bold; font-style: italic; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">out<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">.println(<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #2a00ff; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">&#8220;Animal is jump!&#8221;<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">);<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">}<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">}<\/span><\/p>\n<p><span style=\"font-weight: 400;\">As you can see, there is just one reason to create private methods, they can be used in other methods of their interface.<\/span><\/p>\n<h2><b>Implementing interfaces<\/b><\/h2>\n<p><span style=\"font-weight: 400;\">For interface implementation, the keyword implements are used. Let&#8217;s look at the example:<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: #ffffff; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">public\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">interface<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0Animal {<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: #ffffff; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">public\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">void<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0run();<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">}<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: #ffffff; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">public\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">class<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0Monkey\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">implements<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0Animal {<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #646464; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">@Override<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">public<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">void<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0run() {<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">System.<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #0000c0; background-color: transparent; font-weight: bold; font-style: italic; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">out<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">.println(<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #2a00ff; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">&#8220;Animal is running!&#8221;<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">);<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">}<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">}<\/span><\/p>\n<p><span style=\"font-weight: 400;\">The class has to implement all defined methods of the interface.\u00a0 If it does not implement all methods, you have to declare it as abstract. This code snippet will compile because class Monkey is abstract:<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: #ffffff; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">public\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">interface<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0Animal {<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: #ffffff; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">public\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">void<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0run();<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: #ffffff; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">public\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">String getName();<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">}<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">abstract<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">class<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0Monkey\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">implements<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0Animal {<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #646464; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">@Override<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">public<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">void<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0run() {<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">System.<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #0000c0; background-color: transparent; font-weight: bold; font-style: italic; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">out<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">.println(<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #2a00ff; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">&#8220;Animal is running!&#8221;<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">);<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">}<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">}<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Any class can implement any number of interfaces. In this case, the names of all interfaces must be comma-separated. If your class is concrete it has to provide all methods from all interfaces that it implements. Here is an example:<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">public<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">interface<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0Animal {<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: #ffffff; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: #ffffff; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">public\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">void<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0run();<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">}<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">public<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">interface<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0Mammal {<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">}<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">public<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">interface<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0BananaLover {<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: #ffffff; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">public\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">void<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0eatBanana();<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">}<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">public<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">class<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0Monkey\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">implements<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0Animal, Mammal, BananaLover {<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #646464; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">@Override<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">public<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">void<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0run() {<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">System.<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #0000c0; background-color: transparent; font-weight: bold; font-style: italic; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">out<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">.println(<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #2a00ff; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">&#8220;Animal is running!&#8221;<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">);<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">}<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #646464; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">@Override<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">public<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">void<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0eatBanana() {<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">System.<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #0000c0; background-color: transparent; font-weight: bold; font-style: italic; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">out<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">.println(<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #2a00ff; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">&#8220;Animal is eating banana!&#8221;<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">);<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">}<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">}<\/span><\/p>\n<p><span style=\"font-weight: 400;\"><a href=\"https:\/\/en.wikipedia.org\/wiki\/Interface_(computing)\" rel=\"nofollow noopener\" target=\"_blank\">Interfaces<\/a> cannot be marked as final, because it cannot be instantiated directly. The keyword final prohibits inheritance.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">One interface can extend another interface or interfaces. In this case, the interface inherits all of the abstract methods as its own abstract methods. A concrete class that implements an interface has to implement all inherited by the interface declarations of methods:<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">interface<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0Animal {<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">public<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">void<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0run();<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">}<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">interface<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0Mammal\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">extends<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0Animal{<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">}<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">interface<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0BananaLover\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">extends<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: #ffffff; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">Mammal<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">{<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">public<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">void<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0eatBanana();<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">}<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">class<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0Monkey\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">implements<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0BananaLover {<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #646464; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">@Override<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">public<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">void<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0run() {<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">System.<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #0000c0; background-color: transparent; font-weight: bold; font-style: italic; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">out<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">.println(<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #2a00ff; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">&#8220;Animal is running!&#8221;<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">);<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">}<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #646464; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">@Override<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">public<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">void<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0eatBanana() {<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">System.<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #0000c0; background-color: transparent; font-weight: bold; font-style: italic; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">out<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">.println(<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #2a00ff; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">&#8220;Animal is eating banana!&#8221;<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">);<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">}<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">}<\/span><\/p>\n<p><span style=\"font-weight: 400;\">One interface can extend multiple interfaces:<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">interface<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0Monkey\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">extends<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0Animal,\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: #ffffff; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">Mammal, BananaLover{ \u00a0 \u00a0\u00a0<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: #ffffff; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">}<\/span><\/p>\n<p><span style=\"font-weight: 400;\">All interface variables are public, static and final. Therefore, they have to be initialized. If you try to define variable as private or protected the compiler error will be generated. You can skip public static, final modifiers for <a href=\"https:\/\/www.h2kinfosys.com\/blog\/java-variables-and-data-types\/\">variables <\/a>in interface.<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: #ffffff; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">public<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: #ffffff; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: #ffffff; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">interface<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: #ffffff; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0Animal {<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: #ffffff; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">String\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #0000c0; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">NAME<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0=\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #2a00ff; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">&#8220;Wiki&#8221;<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">;<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">}<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 12pt; font-family: 'Times New Roman'; color: #000000; background-color: #ffffff; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">This is equal to this code snippet:<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: #ffffff; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">public<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: #ffffff; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: #ffffff; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">interface<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: #ffffff; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: #ffffff; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: underline; -webkit-text-decoration-skip: none; text-decoration-skip-ink: none; vertical-align: baseline; white-space: pre-wrap;\">Animal<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: #ffffff; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0{<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: #ffffff; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">public static final String\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #0000c0; background-color: transparent; font-weight: bold; font-style: italic; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">NAME<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0=\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #2a00ff; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">&#8220;Wiki&#8221;<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">;<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">}<\/span><\/p>\n<h2><b>Default interface methods.<\/b><\/h2>\n<p><span style=\"font-weight: 400;\">Starting from JDK 8, there is a possibility to provide a default implementation to methods in interfaces. This type of methods is called a default:<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: #ffffff; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">public<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: #ffffff; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: #ffffff; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">interface<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: #ffffff; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: #ffffff; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: underline; -webkit-text-decoration-skip: none; text-decoration-skip-ink: none; vertical-align: baseline; white-space: pre-wrap;\">Animal<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: #ffffff; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0{<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: #ffffff; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">public<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">default<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">void<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0run() {<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">System.<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #0000c0; background-color: transparent; font-weight: bold; font-style: italic; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">out<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">.println(<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #2a00ff; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">&#8220;Animal is running!&#8221;<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">);<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">}<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">}<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Classes that implement this interface can override this default to implementation or can provide their own.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">We can have a situation with two interfaces that have default methods with the same signature. Let&#8217;s assume that some class implements both interfaces. This code does not compile:<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: #ffffff; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">interface<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: #ffffff; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0Animal {<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: #ffffff; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">public<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">default<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">void<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0run() {<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">System.<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #0000c0; background-color: transparent; font-weight: bold; font-style: italic; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">out<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">.println(<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #2a00ff; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">&#8220;Animal is running!&#8221;<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">);<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">}<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">}<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">interface<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0Mammal {<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">public<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">default<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">void<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0run() {<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">System.<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #0000c0; background-color: transparent; font-weight: bold; font-style: italic; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">out<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">.println(<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #2a00ff; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">&#8220;Animal is running!&#8221;<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">);<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">}<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">}<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">class<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0Monkey\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">implements<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0Animal, Mammal {<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\/\/DOES NOT COMPILE<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">}<\/span><\/p>\n<p><span style=\"font-weight: 400;\">In this case, the compiler will ask to override the method run() in class that implements Animal and Mammal interfaces. This code will compile:<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: #ffffff; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">class<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: #ffffff; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0Monkey\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: #ffffff; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">implements<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: #ffffff; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0Animal, Mammal {<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: #ffffff; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #646464; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">@Override<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">public<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">void<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0run() {<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">System.<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #0000c0; background-color: transparent; font-weight: bold; font-style: italic; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">out<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">.println(<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #2a00ff; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">&#8220;Animal is running!&#8221;<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">);<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">}<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">}<\/span><\/p>\n<h2><b>Static interface methods<\/b><\/h2>\n<p><span style=\"font-weight: 400;\">Since JDK 8, there is a possibility to create static methods in interfaces. It works the same as static methods in classes. Static interface methods cannot be inherited. Thi code does not compile:<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: #ffffff; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">interface<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: #ffffff; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0Jump {<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">static<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">int<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0getHeight() {<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">return<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a01;<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">}<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">}<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">class<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0Kangaroo\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">implements<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0Jump {<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">public<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">void<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0jump() {<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">System.<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #0000c0; background-color: transparent; font-weight: bold; font-style: italic; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">out<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">.println(<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #2a00ff; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">&#8220;Jumping height &#8220;<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0+\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: underline; -webkit-text-decoration-skip: none; text-decoration-skip-ink: none; vertical-align: baseline; white-space: pre-wrap;\">getHeight<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">());\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #3f7f5f; background-color: #000080; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\/\/ DOES NOT COMPILE<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">}<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">}<\/span><\/p>\n<p style=\"padding-left: 60px;\"><span style=\"font-weight: 400;\">To fix this code you need to use the interface name when you use static method:<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">public<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">void<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0jump() {<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">System.<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #0000c0; background-color: transparent; font-weight: bold; font-style: italic; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">out<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">.println(<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #2a00ff; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">&#8220;Jumping height &#8220;<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0+\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: #ffffff; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">Jump.<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: underline; -webkit-text-decoration-skip: none; text-decoration-skip-ink: none; vertical-align: baseline; white-space: pre-wrap;\">getHeight<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">());<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 12pt; font-family: 'Times New Roman'; color: #000000; background-color: #ffffff; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">}<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Now, the code will work.<\/span><\/p>\n<h2><b>Nested interfaces<\/b><\/h2>\n<p><span style=\"font-weight: 400;\">In Java language is possible to create an interface inside another interface. The syntax of the interface and its implementation will look like this:<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: #ffffff; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">interface<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: #ffffff; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0OuterInterface {<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">interface<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0Inner<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: #ffffff; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">Interface<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #646464; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: #ffffff; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">{<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #646464; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">}<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">}<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">class<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0ImplementingClass\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">implements<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0Outer<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: #ffffff; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">Interface<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">.InnerInterface {<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">}<\/span><span style=\"font-size: 12pt; font-family: 'Times New Roman'; color: #000000; background-color: #ffffff; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0<\/span><\/p>\n<p dir=\"ltr\" style=\"padding-left: 60px;\">We can also create declare an interface inside a class:<\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: #ffffff; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">class<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: #ffffff; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0OuterClass {<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">interface<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0InnerInterface {<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">}<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">}<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">class<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0ImplementingClass\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">implements<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0OuterClass.InnerInterface {<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">}<\/span><\/p>\n<h2><b>Functional interfaces<\/b><\/h2>\n<p><span style=\"font-weight: 400;\">Functional interfaces are any interfaces that contain just one abstract method. Its implementation can be a lambda expression. Default and static methods do not count as abstract. You must use the annotation FunctionalInterface for such kind of interfaces:<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #646464; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">@FunctionalInterface<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">interface<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0MyFunctionalInterface {<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">void<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0testMethod();<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">}<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">class<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0ImplementingClass {<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #7f0055; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">void<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0main(String\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #6a3e3e; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">arg<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">[]) {<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">MyFunctionalInterface\u00a0<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #6a3e3e; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: underline; -webkit-text-decoration-skip: none; text-decoration-skip-ink: none; vertical-align: baseline; white-space: pre-wrap;\">functionalInterface<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0= () -&gt; {<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">System.<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #0000c0; background-color: transparent; font-weight: bold; font-style: italic; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">out<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">.println(<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #2a00ff; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">&#8220;Lambda in action&#8221;<\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">);<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">};<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><span class=\"Apple-tab-span\" style=\"white-space: pre;\">\u00a0 \u00a0\u00a0<\/span><\/span><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">}<\/span><\/p>\n<p dir=\"ltr\" style=\"margin-top: 0pt; margin-bottom: 0pt; padding-left: 60px;\"><span style=\"font-size: 10pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">}<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Abstract classes In Java language, which is covered extensively in a java full stack developer course, an abstract class is a class that cannot be instantiated and may or may not contain abstract methods. Both abstract classes and methods are marked with the abstract keyword. Here is an example: public abstract\u00a0class\u00a0Animal { \u00a0 \u00a0\u00a0\/\/ declare [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":2409,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[42],"tags":[451,454,450,58,453,452],"class_list":["post-2275","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-java-tutorials","tag-abstract-class","tag-functional-interfaces","tag-interfaces","tag-java","tag-nested-interfaces","tag-static-interface"],"_links":{"self":[{"href":"https:\/\/www.h2kinfosys.com\/blog\/wp-json\/wp\/v2\/posts\/2275","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.h2kinfosys.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.h2kinfosys.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.h2kinfosys.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.h2kinfosys.com\/blog\/wp-json\/wp\/v2\/comments?post=2275"}],"version-history":[{"count":1,"href":"https:\/\/www.h2kinfosys.com\/blog\/wp-json\/wp\/v2\/posts\/2275\/revisions"}],"predecessor-version":[{"id":33910,"href":"https:\/\/www.h2kinfosys.com\/blog\/wp-json\/wp\/v2\/posts\/2275\/revisions\/33910"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.h2kinfosys.com\/blog\/wp-json\/wp\/v2\/media\/2409"}],"wp:attachment":[{"href":"https:\/\/www.h2kinfosys.com\/blog\/wp-json\/wp\/v2\/media?parent=2275"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.h2kinfosys.com\/blog\/wp-json\/wp\/v2\/categories?post=2275"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.h2kinfosys.com\/blog\/wp-json\/wp\/v2\/tags?post=2275"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}