December 2001
Intermediate to advanced
416 pages
8h 16m
English
Query represents the base class abstraction from which all the actual query types manipulated within our application are inherited. The user should never create an actual instance of a Query object. Rather, a Query object in our program always addresses one of the inherited query types. To enforce this usage model, we modify the Query class definition with the abstract keyword:
abstract public class Query { ... }
The abstract keyword tells both the compiler and readers of our program that it is illegal to create an actual Query class instance. For example, the following attempt to create a Query object triggers a compile-time error:
// error: Query is abstract Query q = new Query();
Rather, a Query object ...
Read now
Unlock full access