Why Java generic classes can't hold static generic variables

as follows, there will be compilation errors. What is the purpose of this design?

public class GenericTest<AnyType> {
    private static AnyType storedValue;//

    public static AnyType read(){//
        return storedValue;
    }
}
Mar.02,2021

static variable can only have one copy in a class, how can it have different types?


GenericTest < String > and GenericTest < Integer > are GenericTest classes after generics are erased, and this class has only one storedValue, that will be ambiguous if generics are allowed.

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-1e469d1-4440a.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-1e469d1-4440a.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?