Title: Sun Certified Java Programmer 310-065-Lesson 31-Generics and Collections (ArrayLists are populated from arrays)-Part 11
Duration: 17 minutes
Summary: In this video, we continue our discussion on generics and collections. Specifically, we will tackle the wild card (?). In some programming scenarios you might see yourself creating similar methods that act on different types (a sum method that adds integers, another one that adds doubles…). To avoid code duplication, you can use the wild card. Here, I will show you how you can create two ArrayLists (one for Integers and another one for Doubles). These ArrayLists are populated from arrays. Then, we will write a single method that sums integers and doubles using the wild card (?). This method will operate on any type that extends Number.
Methodology of the development of example: Good coding standard and simplified design to prepare for the Java programmer certification exam CX-310-065.
Technology Used: Java - Core Concepts.
Keywords: Class, Object, Integer, Double, ArrayList, Number, extends, Arrays.












Post stats:
See the prices for this post in Mr.Bool Credits System below: