Java learning memo (interface)

I'm studying Java Silver, so I'll upload it as my memorandum. Since it is a rough memo, details are not described.

interface does not describe the processing content concretely, but implements the method and uses it later. This is effective when you want to change the processing. If you want to implement interface, use implements.


Point
(1) Method cannot be implemented. (2) Member variables must be constants. ③ Multiple inheritance is possible.

interface A {

String str1 = "Good morning"; String str2 = "Hello"; void A(); }

// Implement the interface and create a class that outputs good morning class B implements A { public void A() { System.out.println(str1); } }

// implements the interface, create a class that output hello class C implements A { public void A() { System.out.println(str2); } }

Recommended Posts

Java learning memo (interface)
Java learning memo (method)
JAVA learning history interface
Java learning memo (inheritance)
Java learning (0)
JAVA learning history interface inheritance
java (interface)
Java memo
[java] interface
Java learning memo (logical operator)
Java learning memo (abstract class)
Java learning memo (creating an array)
Java learning memo (while statement, do-while statement)
java anything memo
About Java interface
Java Silver memo
Java learning day 5
java, maven memo
Java SE 7 memo
[Java] About interface
java anything memo 2
[Java] Functional interface
About interface, java interface
Java specification memo
java learning day 2
Java pattern memo
java learning day 1
(Learning memo) Java Level 2 measures: Question range
About Java functional interface
Java Basic Learning Content 6 (Inheritance / Abstract Class / Interface)
Java development environment memo
java standard functional interface
java learning (conditional expression)
java basic knowledge memo
Java Kuche Day memo
[Java ~ Method ~] Study memo (5)
Learning memo 01 (forward / redirect)
java lambda expression memo
(Memo) Java for statement
Java lambda expression [memo]
[Java] Implicit inheritance memo
java competitive programming memo
[Memo] Java Linked List
Learning memo when learning Java for the first time (personal learning memo)
Learning Java framework # 1 (Mac version)
Java (WebSphere Application Server) memo [1]
Advanced inheritance abstract, interface -java
Java basic learning content 7 (exception)
Java memo (standard class) substring
[Java] Functional interface / lambda expression
Java memo (standard class) length
Java basic learning content 5 (modifier)
Books used for learning Java
4th day of java learning
Java Silver Study Method Memo
[Java ~ Boolean value ~] Study memo (2)
Create a java method [Memo] [java11]
Check Java9 Interface private methods
[Java] Date Related Term Memo
Java study memo 2 with Progate
Java Basic Learning Content 8 (Java API)