The problem of java generics

    public static void printObjects(List<List<?>> args) {

    }

    public static void main(String[] args) {
        List<List<String>> list = new ArrayList<>();
        printObjects(list);
    }

now you want List < list is there any way to do this?

Mar.01,2021

try using syntactic types such as < T >

.

import java.util.*;

public class TestTemp {

public static <T> void printObjects(List<List<T>> args) {

}

public static void main(String[] args) {
    List<List<String>> list = new ArrayList<>();
    printObjects(list);
}

}

Note to declare that this is a template method < T > void.

in front of the corresponding method.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b37286-2adb5.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b37286-2adb5.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?