Chapter 15
Fancy Reference Types
IN THIS CHAPTER
Writing and using a Java interface
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:
- Primitive types: Java has a total of eight primitive types: The four you use most often are
int
,double
,boolean
, andchar
. Reference types: 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'sScanner
,JFrame
,ArrayList
, andFile
types. MyDummiesFrame
is a reference type. In Chapter 8, you create your ownEmployee
,FullTimeEmployee
, andPartTimeEmployee
reference types. Your first You'll love Java! program has amain
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 ...
Get Java For Dummies, 8th Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.