package com.zbf.system.test;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

public class GenericsExample {
    public static void main(String[] args) {
        List<Integer> intList = new ArrayList<>();
        intList.add(3);
        printList(intList); // This will now work without errors.
    }

    private static void printList(List<?> myList) { // Change the parameter type to List<Integer>
        for (Object num : myList) {
            System.out.println(num);
        }
    }
}
