/* package whatever; // don't place package name! */ import java.util.*;import java.lang.*;import java.io.*; /* Name of the class has to be "Main" only if the class is public. */class Ideone{ public <T extends Object> ArrayList<T> take(ArrayList<T> list){ return new ArrayList<String>(); } public static void main (String[] args) throws java.lang.Exception { System.out.println("Done."); }}
Standard input is empty
Main.java:11: error: incompatible types return new ArrayList<String>(); ^ required: ArrayList<T> found: ArrayList<String> where T is a type-variable: T extends Object declared in method <T>take(ArrayList<T>) 1 error
Standard output is empty
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!