Limited access

Upgrade to access all content for this subject

Consider the following method.

public static void listAdjustments(ArrayList list)
    for (int i=0; i<list.size(); i++)
        if (list.get(i) instanceof Integer | | list.get(i) instanceof Double)
            list.set(i, list.get(i)+"");
        if (!(list.get(i) instanceof String)) 
            list.set(i, list.get(i)+"");

Consider the following code from the main method.

ArrayList list = // a list of Objects

Which one of the following statements is true about list after this method is called?


All elements in list will remain unchanged.


Every element in list will be a String.


Executing the command System.out.println(list); before calling the method and then executing it again after calling the method will result in different output.


The data types at each position in list will be the same before and after calling the method.


This method will produce a data type conversion error when called.

Select an assignment template