---
title: "Java: Interfaces"
date: 2015-01-01
description: "Tom Johnson’s blog on technical writing and AI: agent skills, docs for AI agents, docs-as-code, tech comm careers, and an API documentation course."
canonical_url: https://idratherbewriting.com/java-interfaces/index
---

> For AI agents: a documentation index is available at https://idratherbewriting.com/llms.txt. Markdown versions of all pages are available by appending .md to any page URL.

# Java: Interfaces

## Quick summary

Interfaces:

- Interfaces can’t be instantiated
- Interfaces have methods with no bodies (no {})
- Subclasses *implement* interfaces (as many as they want)
- Subclasses must implement *all* the interface’s methods
- Interfaces standardize methods and fields for all subclasses
- All fields are final static
- The default access for an interface is protected
- The default access for an interface’s methods is public

Eclipse example: Interfaces

## Detailed description

An interface is a class that has methods with no bodies. It is intended to be implemented by another class that will insert their own values for the methods. It’s a way of formalizing a class that will have a lot of subclasses, when you want all the subclasses to standardize on common strings and methods.
