How do I use printf to print arraylist of different variables : I have an arraylist filled with different variables, how would I print this arraylist out using the **printf** flag in Java?


    public class mendietaRAL {
        public static void theArrayList() {
            ArrayList<Object> theList = new ArrayList<Object>();
    
            theList.add(123);
            theList.add("Java");
            theList.add(3.75);
            theList.add("Summer C");
            theList.add(2018);
    
            for (int i = 0; i < theList.size(); i++) {
                System.out.printf(theList.get(i));
            }
    
    
            theList.remove(1);
            theList.remove(3);
    
            System.out.println();
    
            for (int i = 0; i < theList.size(); i++) {
                System.out.printf(theList.get(i));
            }
        }
    }

