O'Reilly logo

Oracle Certified Associate, Java SE 7 Programmer Study Guide by Richard M. Reese

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

Exploring the structure of a class

Programming can be thought of as code manipulating data. In Java, code is organized around the following:

  • Packages
  • Classes
  • Methods

Packages are collections of classes with similar functionality. Classes are composed of methods that support the functionality of the class. This organization provides structure to applications. Classes will always be in a package and methods will always be in a class.

Note

If the package statement is not included in a class definition, the class becomes part of a default package which consists of all of the classes in the same directory that doesn't have a package statement.

Classes, interfaces, and objects

A class is the fundamental building block of object-oriented programs. It generally ...

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