Course Hero Logo

9-Java-3-Collections.pptx - JAVA Collections Agenda: ▪ What...

Course Hero uses AI to attempt to automatically extract content from documents to surface to you and others so you can study better, e.g., in search results, to enrich docs, and more. This preview shows page 1 - 6 out of 10 pages.

JAVACollections
Agenda:2What are Collections?Java Data Structures - Collections-Array and Arraylist
ListCollectionsWhat is Enumeration Type? ENUM3Enumerations serve the purpose of representing a group of named constants ina programming language.For example:-4 suits in a deck of playing cards may be 4 enumerators named Club,Diamond, Heart, and Spade, belonging to an enumerated type namedSuit.-Other examples include natural enumerated types (like the planets, daysof the week, colors, directions, etc.).Enums are used when we know all possible values atcompile time, such aschoices on a menu, rounding modes, command line flags, etc. It is not necessarythat the set of constants in an enum type stayfixedfor all time.
Collections:What areCollections?4
ListCollectionsWhat is List Collection?5void add(int index,Object O):This method adds given element at specifiedindex.boolean addAll(int index, Collection c):This method adds all elements fromspecified collection to list. First element gets inserted at given index. If there isalready an element at that position, that element and other subsequentelements(if any) are shifted to the right by increasing their index.

Upload your study docs or become a

Course Hero member to access this document

Upload your study docs or become a

Course Hero member to access this document

End of preview. Want to read all 10 pages?

Upload your study docs or become a

Course Hero member to access this document

Term
Spring
Professor
NoProfessor
Tags
Enumerated type

Newly uploaded documents

Show More

Newly uploaded documents

Show More

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture