PDF4PRO ⚡AMP

Modern search engine that looking for books and documents around the web

Example: marketing

Collections in Java - AAU

OOP: Collections1 Collections in java ArraysnHas special language support IteratorsnIterator (i) Collections (also called containers)nCollection (i)nSet (i), uHashSet (c), TreeSet (c)nList (i), uArrayList (c), LinkedList (c)nMap (i), uHashMap (c), TreeMap (c)OOP: Collections2 Array Most efficient way to hold references to objects. AdvantagesnAn array know the type it holds, , compile-time type array know its size, , ask for the array can hold primitive types directly. DisadvantagesnAn array can only hold one type of objects (including primitives).nArrays are fixed : Collections3 Array, Example Helper class and sort: binarySearch(), sort()nComparison: equals()(many overloaded)nInstantiation: fill()(many overloaded)nConversion: asList()class Car{};// minimal dummy classCar[] cars1; // null referenceCar[] cars2 = new Car[10]; // null referencesfor (int i = 0; i < ; i++)cars2

OOP: Collections 2 Array • Most efficient way to hold references to objects. • Advantages n An array know the type it holds, i.e., compile-time type checking. n An array know its size, i.e., ask for the length. n An array can hold primitive types directly. • Disadvantages n An array can only hold one type of objects (including primitives). n Arrays are fixed size.

Loading..

Tags:

  Collection, Java, Collections in java

Information

Domain:

Source:

Link to this page:

Please notify us if you found a problem with this document:

Spam in document Broken preview Other abuse

Transcription of Collections in Java - AAU

Related search queries