J2EE+Essentials

  • Upload
    ammad

  • View
    223

  • Download
    0

Embed Size (px)

DESCRIPTION

J2ee lecture

Citation preview

PowerPoint Presentation

Enterprise System EssentialsCore to Java EEEnterprise System EssentialsCollectionsNetwork Programming (TCP / UDP)CollectionGenericsCollectionA collection is a container object that holds a group of objects known as elements.It contains operations for Adding, Updating, and Removing elements A Collections framework is a unified architecture for representing and manipulating collections. It has: Interfaces: abstract data types representing collectionsImplementations: concrete implementations of the collection interfacesAlgorithms: methods that perform useful computations, such as searching and sortingThese algorithms are said to be polymorphic: the same method can be used on different implementationsCollection Interface

5Collection Interface

6Collection Interface

7Wildcards in CollectionClasses and interfaces in the collection framework can have parameter type specifications that do not fully specify the type plugged in for the type parameterBecause they specify a wide range of argument types, they are known as wildcards

public void method(String arg1, ArrayList arg2)

In the above example, the first argument is of type String, while the second argument can be an ArrayList with any base typeA bound can be placed on a wildcard specifying that the type used must be an ancestor type or descendent type of some class or interfaceThe notation