subtype : Java Glossary

*0-9ABCDEFGHIJKLMNOPQRSTUVWXYZ (all)

subtype
Starting with Java 1.5, When you have generics, List<String> (a List guaranteed to contain nothing but Strings) and List<?> (a List containing any sort of Object) are considered the same class, however, List<String> is a subtype of List<?> because every List<String> is also a List<?>. When you override a method, you have the option of returning an object of a subtype of the one returned by the method in the base class. In other words, you can narrow but not widen what the method can return.

This page is posted
on the web at:

http://mindprod.com/jgloss/subtype.html

Optional Replicator mirror
of mindprod.com
on local hard disk J:

J:\mindprod\jgloss\subtype.html
Canadian Mind Products
Please the feedback from other visitors, or your own feedback about the site.
Contact Roedy. Please feel free to link to this page without explicit permission.

IP:[65.110.21.43]
Your face IP:[18.221.187.121]
You are visitor number