O'Reilly logo

NetBeans IDE 8 Cookbook by Rhawi Dantas, David Salter

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating an interface

A good development practice is to use interfaces to group together related functions. Coding to an interface allows a developer to easily switch the implementation to another defined by an interface and helps to keep the contract between code modules.

An interface defines a set of related methods that have no bodies that a Java class can then implement. NetBeans allows us to create an empty interface in a similar fashion to creating an empty class as described in the Creating a class recipe earlier in this chapter.

Getting ready

It is necessary to have a project in order to create an interface; so, if you are unsure on how to do this, please check the recipes in Chapter 1, Using NetBeans Projects. To help follow this recipe, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required