Java LinkedList Quiz

Home

Question: 1 2 3 4 5 6 7 8 9

Question One

Which of the following interfaces does a LinkedList implement?


top next

Question Two

Which is faster at accessing the midpoint?


back top next

Question Three

True or False: The order in which elements are inserted into a LinkedList is preserved?


back top next

Question Four

For a LinkedList, which is faster to find?


back top next

Question Five

  public class Test{
    public static void main(String[] args){
      LinkedList<Integer> list = new LinkedList<Integer>();
      list.add(3);
      list.add(1);
      list.add(2);
      System.out.println(list.getFirst());
      }
    }
  }
  

What is printed by the code?


back top next

Question Six

  public class Test{
      LinkedList<Integer> list = new LinkedList<Integer>();
      list.add(1);
      Integer x = list.get(1);   
  }
  

What is the value of x?


back top next

Question Seven

  public class Test{
      LinkedList<String> list = new LinkedList<String>();
      list.add("a");
      list.add("b");
      list.add("c");
      String x = list.get(1);   
  }
  

What is the value of x?


back top next

Question Eight

  public class Test{
      LinkedList<String> list = new LinkedList<String>();
      list.add("a");
      list.add("b");
      list.add("c");
      int x = list.indexOf("a");   
  }
  

What is the value of x?


back top next


Question Nine

True or False: Java ArrayList uses a LinkedList in its implementation


back top next

Question Ten

Which uses more memory to store the same amount of data


back top