Asked by: Eliecer Clausi
Asked in category: technology and computing, programming languages
Last Updated: 5th Jul 2024

What is the naming convention for interfaces?

Influenced: Java (programming language)



How do you name interfaces then?

Name conventions for interfaces in Java Interfaces must be written in titlecase, with each word's first letter capitalized. interfaces are also valid nouns if they represent a group of classes, e.g. List and Map

How do you name your classes, other than the above? Summary

  1. Move one level higher than body (all except for class names).
  2. The class name should be descriptive of the responsibility.
  3. Respect only one responsibility (one rule)
  4. Divide problems into smaller parts

Afterwards, you might also wonder, "How do I implement an interface name?"

There's two major naming conventions that Java interfaces use:

  1. Interfaces do not require a prefix or suffix. Implementations will need a suffix.
  2. ~I. prefix for interfaces but no suffix or prefix for implementations.

Can we define properties in interface?

Interfaces are contracts that can be fulfilled using implementing classes. They may contain properties , methods and events (indexers also allowed). variables can be included in Base classes. Properties in Interfaces – Yes, they are paired methods underneath the hood.