Object-Oriented Programming Concepts

Object-Oriented Programming Concepts If you’ve never used an object-oriented programming language before, you’ll need to learn a few basic concepts before you can begin writing any code. This lesson will introduce you to objects, classes, inheritance, interfaces, and packages. Each discussion focuses on how these concepts relate to the real world, while simultaneously providing an […]

What Is an Interface?

What Is an Interface? As you’ve already learned, objects define their interaction with the outside world through the methods that they expose. Methods form the object’s interface with the outside world; the buttons on the front of your television set, for example, are the interface between you and the electrical wiring on the other side […]

Questions and Exercises: Object-Oriented Programming Concepts

Questions and Exercises: Object-Oriented Programming Concepts Questions Real-world objects contain ___ and ___. A software object’s state is stored in ___. A software object’s behavior is exposed through ___. Hiding internal data from the outside world, and accessing it only through publicly exposed methods is known as data ___. A blueprint for a software object […]

Answers to Questions and Exercises: Object-Oriented Programming Concepts

Answers to Questions and Exercises: Object-Oriented Programming Concepts Answers to Questions Real-world objects contain state and behavior. A software object’s state is stored in fields. A software object’s behavior is exposed through methods. Hiding internal data from the outside world, and accessing it only through publicly exposed methods is known as data encapsulation. A blueprint […]

What Is a Package?

What Is a Package? A package is a namespace that organizes a set of related classes and interfaces. Conceptually you can think of packages as being similar to different folders on your computer. You might keep HTML pages in one folder, images in another, and scripts or applications in yet another. Because software written in […]

What Is Inheritance?

What Is Inheritance? Different kinds of objects often have a certain amount in common with each other. Mountain bikes, road bikes, and tandem bikes, for example, all share the characteristics of bicycles (current speed, current pedal cadence, current gear). Yet each also defines additional features that make them different: tandem bicycles have two seats and […]

What Is a Class?

What Is a Class? In the real world, you’ll often find many individual objects all of the same kind. There may be thousands of other bicycles in existence, all of the same make and model. Each bicycle was built from the same set of blueprints and therefore contains the same components. In object-oriented terms, we […]

What Is an Object?

What Is an Object? Objects are key to understanding object-oriented technology. Look around right now and you’ll find many examples of real-world objects: your dog, your desk, your television set, your bicycle. Real-world objects share two characteristics: They all have state and behavior. Dogs have state (name, color, breed, hungry) and behavior (barking, fetching, wagging […]

Creating and Using Extensions

Creating and Using Extensions Any set of packages or classes can easily be made to play the role of an extension. The first step in turning a set of classes into an extension is to bundle them in a JAR file. Once that’s done, you can turn the software into an extension in two ways: […]

Understanding Extension Class Loading

Understanding Extension Class Loading The extension framework makes use of the class-loading delegation mechanism. When the runtime environment needs to load a new class for an application, it looks for the class in the following locations, in order: Bootstrap classes: the runtime classes in rt.jar, internationalization classes in i18n.jar, and others. Installed extensions: classes in […]