UNPKG

epubjs

Version:

Render ePub documents in the browser, across many devices

14 lines (13 loc) 1.93 kB
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"><head><title>Chapter 6. Relationships Among Classes</title><link rel="stylesheet" href="core.css" type="text/css"/><meta name="generator" content="DocBook XSL Stylesheets V1.74.0"/></head><body><div class="chapter" title="Chapter 6. Relationships Among Classes"><div class="titlepage"><div><div><h1 class="title"><a id="learnjava3-CHP-6"/>Chapter 6. Relationships Among Classes</h1></div></div></div><p>So far in our exploration of Java, we have seen how to create Java classes and objects, which are instances of those classes. By themselves, classes would be little more than a convention for organizing code. It is in the relationships between objects—their connections and privileges with respect to one another—that the power of an object-oriented language is really expressed.</p><p>That’s what we’ll cover in this chapter. In particular, we’ll look at several kinds of relationships:</p><div class="variablelist"><dl><dt><span class="term"><span class="emphasis"><em>Inheritance relationships</em></span></span></dt><dd><p>How a class inherits methods and variables from its parent class</p></dd><dt><span class="term"><span class="emphasis"><em>Interfaces</em></span></span></dt><dd><p>How to declare that a class implements certain behavior and define a type to refer to that behavior</p></dd><dt><span class="term"><span class="emphasis"><em>Packaging</em></span></span></dt><dd><p>How to organize objects into logical groups</p></dd><dt><span class="term"><span class="emphasis"><em>Inner classes</em></span></span></dt><dd><p>A generalization of classes that lets you nest a class definition inside another class definition</p></dd></dl></div></div></body></html>