O'Reilly logo

The class of Java by Pravin Jain

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

CHAPTER 9

Creating Packages and Using Access Specifiers

What is a package in Java? In Java, package is a collection of related classes and interfaces. Just like we organize our files into folders, we normally have a Documents folder to keep all document files, a Music folder to keep all music files, a Videos folder to keep all video files; similarly we organize our classes and interfaces in Java into various packages.

In the earlier chapters and exercises, we have defined a few classes like the Rectangle and the Cuboid classes in Chapter 6 and then the Account, SavingsAccount and the CurrentAccount classes in Exercise 8.1. Now the classes like Rectangle and Cuboid are related to geometrical shapes, and the Account, SavingsAccount and the CurrentAccount ...

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