I've been doing an Android tutorial and encountered a class with the following:
public class ImageAndTextAdapter extends ArrayAdapter {
Is the a form of inheritance by type? Or is it some other Java syntax that I should know about?
The class is:
android.widget.ArrayAdapter
解决方案
This is called generics. The class within < and > is a type parameter.
This is easiest explained by an example:
An ArrayList can store items. If you specify a type parameter like this: ArrayList then this array list will store items of String type only, (in other words, it will store Strings only)!
Similarly, the ArrayAdapter is "parameterized" by a type as well. The ArrayAdapter probably holds a value, and this value will be of the type specified between < and >, which in your case is String.
Useful links: