close

在此介紹一個Java裡的現成串列

add是增加一個資料到尾巴

size可以看現在長度

remove是從該編號刪除,可見為鍊結串列形式

import java.util.*; 
public class c20190319 {
    public static void main(String[] a){
        List<Integer> buf1 = new ArrayList<Integer>();
        buf1.add(69);
        buf1.add(100);
        System.out.println(buf1.size());
        buf1.remove(0);
        System.out.println(buf1.size());
    }
}


在此為繼承是 視窗功能的class(?)

 

package win001;

import java.awt.*;

public class c001 extends Frame{
    c001(){   /*建構子-裡面設定視窗的屬性*/
        this.setSize(600,500);
        this.setLocation(200,50);
        this.setVisible(true);
    }
    
    public static void main(String[] a)
    {
        c001 b = new c001();
    }
}

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 Kuihao 的頭像
    Kuihao

    溫暖午後的金針田__孕育有趣的創新

    Kuihao 發表在 痞客邦 留言(0) 人氣()