Skip to main content

Posts

Featured

Java Array List Example Program

package com.practice.list; import java.util.*; public class ArrayListExample {    public static void main(String args[]) {       // create an array list       ArrayList al = new ArrayList();       System.out.println("Initial size of al: " + al.size());       // add elements to the array list       al.add("M");       al.add("A");       al.add("D");       al.add("D");       al.add("Y");             al.add(1, "A");       System.out.println("Size of al after additions: " + al.size());       // display the array list       System.out.println("Contents of al: " + al);       // Remove elements from the array list       al.remove("D");       al.remove(2);       System.out.println("Size of al af...

Latest Posts

Java Map Example (Add,List - Non-Generic)

Java Map Example (Add , List - Generic)

Java with MySQL JDBC Connection Example Program

Find Duplicate String in Java

Java Armstrong Example Program

String endsWith() Example Program

String getBytes() Example Program

String toCharArray() Example Program

String equalsIgnoreCase() Example Program

String contains() Example Program