fork(2) download
  1. import java.util.List;
  2.  
  3. class Product {
  4.  
  5. }
  6.  
  7. interface Dao {
  8. public <T> List<T> getList(List<String> idList);
  9. public <T> List<T> getAll();
  10. }
  11.  
  12. class Impl implements Dao {
  13. @Override
  14. public List<Product> getList(List<String> idList) {
  15. return null;
  16. }
  17.  
  18. @Override
  19. public List<Product> getAll() {
  20. return null;
  21.  
  22. }
  23.  
  24. }
  25.  
  26. public class MainJ {
  27.  
  28. public static void main(String[] args) {
  29. System.out.println("Done");
  30. }
  31. }
  32.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:26: error: class MainJ is public, should be declared in a file named MainJ.java
public class MainJ {
       ^
Main.java:12: error: Impl is not abstract and does not override abstract method <T>getList(List<String>) in Dao
class Impl implements Dao {
^
  where T is a type-variable:
    T extends Object declared in method <T>getList(List<String>)
Main.java:14: error: name clash: getList(List<String>) in Impl and <T>getList(List<String>) in Dao have the same erasure, yet neither overrides the other
    public  List<Product> getList(List<String> idList) {
                          ^
  where T is a type-variable:
    T extends Object declared in method <T>getList(List<String>)
Main.java:13: error: method does not override or implement a method from a supertype
    @Override
    ^
Note: Main.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
4 errors
stdout
Standard output is empty