The core concept of Java: interface (interface)
Interfaces are at the same level as classes, and in fact, interfaces are a special kind of abstract class.
Such as:
Interface ia{
}
Public interface: Open Interface
Similar to a class, a file can have only one public interface and is the same as the file name.
A public interface and a public class cannot be defined in a file at the same time.
In an interface, all methods are public, abstract, and all properties are public, static, and constant.
A class implements the format of an interface:
Class Iaimple implements ia{
};
A class implements an interface, which is equivalent to inheriting an abstract class.
1 PackageTomtext;2 //examples of the use of relational operators. 3 Public classtomtext_32 {4 Public Static voidMain (String args[]) {5 floatA =10.0f;6 Doubleb = 10.0;7 if(A = =b) {8System.out.println ("A and B are equal");9}Else{TenSystem.out.println ("A and b are not equal"); One } A } - -}
The core concept of Java: interface (interface)