fork download
  1. class Gen
  2. {
  3. G g;
  4. Gen(G g)
  5. {
  6. this.g =g;
  7. }
  8. public static void main(String[] args)
  9. {
  10. Gen arr[] = new Gen[5]; //line 1
  11. arr[0] = new Gen("Java"); //line 2
  12. arr[1] = new Gen(1); //line 3
  13. arr[2] = (Gen)new Gen(1); //line 4
  14. arr[3] = (Gen)new Gen(1); //line 5
  15. for(Gen o:arr)
  16. {
  17. System.out.println(o);
  18. }
  19. }
  20. }
  21.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:3: error: cannot find symbol
G g; 
^
  symbol:   class G
  location: class Gen
Main.java:4: error: cannot find symbol
Gen(G g) 
    ^
  symbol:   class G
  location: class Gen
2 errors
stdout
Standard output is empty