⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 e349. creating a list.txt

📁 这里面包含了一百多个JAVA源文件
💻 TXT
字号:
// Create the list
    List list = new LinkedList();    // Doubly-linked list
    list = new ArrayList();          // List implemented as growable array
    
    // Append an element to the list
    list.add("a");
    
    // Insert an element at the head of the list
    list.add(0, "b");
    
    // Get the number of elements in the list
    int size = list.size();          // 2
    
    // Retrieving the element at the end of the list
    Object element = list.get(list.size()-1);   // a
    
    // Retrieving the element at the head of the list
    element = list.get(0);                      // b
    
    // Remove the first occurrence of an element
    boolean b = list.remove("b");      // true
    b = list.remove("b");              // false
    
    // Remove the element at a particular index
    element = list.remove(0);          // a

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -