41. Class set Framework (i)

Source: Internet
Author: User

Learning Essentials:

    1. What is a class set framework

    2. Types of collections

    3. The basic mechanism of the class set framework


What is a class set framework

    1. A class set framework is a set of classes and interfaces

    2. Located in the Java.util bag;

    3. The primary user stores and manages objects;

    4. Divided into three main categories-collections, lists, and mappings


What is a collection (set)

The objects in the collection have no order and no duplicate objects


What are lists (list)

Objects in the collection are sorted by index location and can have duplicate objects


What is mapping (map)

Each element in the collection contains a key object and a value object, the key cannot be duplicated, and the value can be repeated

Import Java.util.list;import java.util.arraylist;interface test{public static void Main (String args[]) {arraylist< string> arrayList = new arraylist<string> () Arraylist.add ("a");//Add Data Arraylist.add ("B"); Arraylist.add ("C" ); Arraylist.remove (1); Delete element ' B ' for (int i = 0; Arraylist.size (); i++) {String s = arraylist.get (1); System.out.println (s);}}}


41. Class set Framework (i)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.