GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — algorithm/arrayList/ArrayListBasic.java at java · itsvinayak/algorithm Expand file tree/ Copy pathArrayListBasic.javaMore file actions 31 lines (29 loc) · 886 Bytes / Copy pathArrayListBasic.javaFile metadata and controls31 lines (29 loc) · 886 Bytes 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 package arrayList; import java.util.ArrayList; public class ArrayListBasic { public static void main(String[] args) { ArrayList<Integer> arr = new ArrayList<Integer>(); arr.add(1); arr.add(2); arr.add(3); arr.add(4); System.out.println(arr); arr.add(1, 5); System.out.println(arr); arr.remove(1); System.out.println(arr); System.out.println(arr.get(1)); System.out.println(arr.size()); System.out.println(arr.contains(3)); System.out.println(arr.indexOf(3)); System.out.println(arr.isEmpty()); arr.clear(); System.out.println(arr); System.out.println(arr.isEmpty()); ArrayList<Object> arr2 = new ArrayList<>(); arr2.add(1); arr2.add("Hello"); arr2.add(3.14); System.out.println(arr2); } } |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |