O'Reilly logo

Instant NetBeans IDE How-to by Atul Palandurkar

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

Using interfaces (Must know)

In this recipe, we learn to write and implement interfaces using NetBeans IDE.

How to do it...

  1. Create a simple Java project named InterfaceDemo. Do not create a Main class, that is, uncheck the Create Main Class field.
  2. Create a package named interfacedemo.
  3. Go to File | New File... or simply click on the New File... icon from the toolbar.
  4. Select Java from Categories and Java Interface from File Types, then click on Next to proceed.
  5. Enter File Name as Book and define the package in which you want the interface to be created. Here the interfacedemo package is selected.
  6. Click on Finish.

A Test interface is created in the interfacedemo package.

Creating interface

We will now write the method signatures and the variable. Also, we ...

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