LOOKING FOR NATIVE WRITERS
October 17, 2021
Reading Assignment
October 17, 2021

mis java programing

Write a program that uses the ArrayList class and populate it with a list of your course codes, i.e MIS210, then use the ArrayList methods described in the example in class to add, remove, and display information about the ArrayList.

 

simple example of ArrayList:

 

package bmarina;

import java.util.ArrayList;

public class ArrayListExample {

    public static void main(String[] args) {

        ArrayList cityList = new ArrayList();

        cityList.add(“London”);

        cityList.add(“New York”);

        cityList.add(“Paris”);

        cityList.add(“Toronto”);

        cityList.add(“Hong Kong”);

        cityList.add(“Singapore”);

        System.out.println(“List size is ” + cityList.size());

        System.out.println(“Is Toronto in the list? ” + cityList.contains(“Toronto”));

        System.out.println(“The location of New York in the list is ” + cityList.indexOf(“New York”));

        System.out.println(“Is the list empty? ” + cityList.isEmpty());

        cityList.add(2, “Beijin”);

        System.out.println(“List size is ” + cityList.size());

        System.out.println(“The location of Beijin in the list is ” + cityList.indexOf(“Beijin”));

        cityList.remove(“Toronto”);

        System.out.println(“List size is ” + cityList.size());

        cityList.remove(0);

        System.out.println(“List size is ” + cityList.size());

        System.out.println(cityList.toString());

        for (int i = cityList.size() – 1; i >= 0 ; i–) {

         System.out.print(cityList.get(i) + ” “);  

        }

        System.out.println();

    }

}

 
Do you need a similar assignment done for you from scratch? We have qualified writers to help you. We assure you an A+ quality paper that is free from plagiarism. Order now for an Amazing Discount!
Use Discount Code "Newclient" for a 15% Discount!

NB: We do not resell papers. Upon ordering, we do an original paper exclusively for you.

Buy Custom Nursing Papers