Java Interface Naming Convention

In this post, we will discuss the Java Interface naming conventions with examples.

Read complete Java naming conventions at https://www.javaguides.net/2018/08/java-standard-naming-conventions.html.

Interfaces naming conventions

In Java, interfaces names, generally, should be adjectives. Interfaces should be in title case with the first letter of each separate word capitalized. In some cases, interfaces can be nouns as well when they present a family of classes e.g. List and Map.
Example:
Runnable
Remote
ActionListener
Appendable
AutoCloseable
CharSequence
Cloneable
Comparable
Readable
Few more examples:
public interface Serializable {}
 
public interface Clonable {}
 
public interface Iterable {}
 
public interface List {}

Reference




Comments