5
Помилка в компіляторі eclipse або в javac (“параметри типу T неможливо визначити”)
Наступний код public class GenericsTest2 { public static void main(String[] args) throws Exception { Integer i = readObject(args[0]); System.out.println(i); } public static <T> T readObject(String file) throws Exception { return readObject(new ObjectInputStream(new FileInputStream(file))); // closing the stream in finally removed to get a small example } @SuppressWarnings("unchecked") public static <T> …