Presentation is loading. Please wait.

Presentation is loading. Please wait.

University of Central Florida COP 3330 Object Oriented Programming

Similar presentations


Presentation on theme: "University of Central Florida COP 3330 Object Oriented Programming"— Presentation transcript:

1 University of Central Florida COP 3330 Object Oriented Programming

2 Agenda Constants Collections Classes

3 Constants

4 Constants Java does not directly support constants. However, a static final variable is effectively a constant. The static modifier causes the variable to be available without loading an instance of the class where it is defined. The final modifier causes the variable to be unchangeable. Java constants are normally declared in ALL CAPS. Words in Java constants are normally separated by underscores. public class MaxUnits {     public static final int MAX_UNITS = 25; }

5 Collections Classes

6 Collections Classes The following are classes from the Collections framework used to group objects together 1. ArrayList 2. LinkedList 3. Vector 4. HashSet 5. LinkedHashSet 6. TreeSet 7. HashMap 8. TreeMap 9. LinkedHashMap 10. Hashtable 11. Iterator and ListIterator 12. Comparable and Comparator

7 Collections Classes For the MasterMind project purposes this will focus on the classes that will be used to accomplish our goals. ArrayList HashSet

8 Collections Classes ArrayList
The java.util.ArrayList class provides resizable-array and implements the List interface It implements all optional List operations and it also permits all elements, including null It provides methods to manipulate the size of the array that is used internally to store the list

9 Collections Classes HashSet
HashSet extends AbstractSet and implements the Set interface. It creates a collection that uses a hash table for storage. A hash table stores information by using a mechanism called hashing. In hashing, the informational content of a key is used to determine a unique value, called its hash code. The hash code is then used as the index at which the data associated with the key is stored. The transformation of the key into its hash code is performed automatically.


Download ppt "University of Central Florida COP 3330 Object Oriented Programming"

Similar presentations


Ads by Google