O'Reilly logo

Java For Dummies, 7th Edition by Barry A. Burd

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 15

Fancy Reference Types

IN THIS CHAPTER

check Writing and using a Java interface

check Working with abstract classes

In previous chapters, you may have read about the things that full-time and part-time employees have in common. In particular, both the FullTimeEmployee and PartTimeEmployee classes can extend the Employee class. That's nice to know if you're running a small business, but what if you're not running a business? What if you're taking care of house pets?

This chapter explores the care of house pets and other burning issues.

Java’s Types

Chapter 4 explains that Java has these two kinds of types:

  • Java has eight primitive types.

    The four that you use most often are int, double, boolean, and char.

  • Java's API has thousands of reference types. And, when you write a Java program, you define new reference types.

    Java's String type is a reference type. So are Java's Scanner, JFrame, ArrayList, and File types. My DummiesFrame is a reference type. In Chapter 7, you create your own Employee, FullTimeEmployee, and PartTimeEmployee reference types. Your first You'll love Java! program has a main method inside of a class, and that class is a reference type. You may not realize it, but every array belongs to a reference type.

In Java, reference types are everywhere. But until ...

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