Tambahkan Item ke ArrayList Menggunakan Fungsi Add ()
import java.util.ArrayList;
class Main {
public static void main(String[] args){
// create ArrayList
ArrayList<String> Websites = new ArrayList<>();
// add() method without the index parameter
Websites.add("Softhunt.net");
Websites.add("Pythonprogramming.com");
Websites.add("Tutorial.io");
System.out.println("ArrayList: " + Websites);
}
}
Outrageous Ostrich