Answer to Question #256460 in Java | JSP | JSF for Ntokozo

Question #256460

Design and analyze and code a method for generic mArrayList that will manipulate tge linkedlist


1
Expert's answer
2021-10-25T16:54:58-0400


import java.util.*;
  
public class mArrayList {
  
    public static void main(String args[])
    {
        LinkedList<String> element
            = new LinkedList<String>();
       System.out.println("Adding elements");
        element.add("1");
        element.add("2");
        element.addLast("3");
        element.addFirst("4");
        element.add(2, "5");
  
        System.out.println(element);
        System.out.println("Removing elements");
        element.remove("2");
        element.remove(3);
        element.removeFirst();
        element.removeLast();
  
        System.out.println(element);
    }
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS