April 2003
Intermediate to advanced
496 pages
9h 59m
English
Consider the following common programming situation. You write an analysis method where part of the analysis is generic and part is specific to a given problem. As a good Java programmer, you don't want a different version of the method for every problem it might be used to solve. What you want is to write one generic version of the method that accepts the problem-specific information as an argument.
In C the answer would be to use a function pointer. As the name implies, it is a pointer to a generic function with a certain input parameter list. Java doesn't have function pointers, but you can do the same thing by using classes. A class can be defined to contain problem-specific information. An instance of the ...
Read now
Unlock full access