Recent Posts
-
Implications for Overloading – Generics
•
Implications for Overriding The following conditions (referred to as override criteria) should be satisfied in order for a subtype method to override a supertype method: Here we discuss the implication of method signatures for overriding. The @Override Annotation We can solicit the aid of the compiler to ensure that a…
-
Calling Generic Methods – Generics
•
Calling Generic Methods Consider the following class declaration: Click here to view code image public class ClassDecl { static <E_1,…, E_k> void genericMethod(P_1 p_1,…, P_m p_m) { … } // …} Note that in the method declaration above, a type P_i may or may not be from the list of…
-
Comparing Unmodifiable Lists and List Views – Collections, Part I: ArrayList
•
Comparing Unmodifiable Lists and List Views There are subtle differences to be aware of between unmodifiable lists and list views. The Arrays.asList() method returns a fixed-size list view that is backed by the array passed as an argument so that any changes made to the array are reflected in the…