I have problem when I compile my program: This is in Javabook\"Start out with Ja
ID: 3615115 • Letter: I
Question
I have problem when I compile my program: This is in Javabook"Start out with Java" by Tony Gaddis & GodfreyMuganda E [ ] array = new E [20]; // Error I don't know what is wrong with it. Something wrong in this one too if (elements = = list.size ( )) resize ( ); // this is full,who can I resize it. Error,, this is used to instantiate iterators for a listclass public class MyIterator<E> implementsIterable<E> { ....code } I have problem when I compile my program: This is in Javabook"Start out with Java" by Tony Gaddis & GodfreyMuganda E [ ] array = new E [20]; // Error I don't know what is wrong with it. Something wrong in this one too if (elements = = list.size ( )) resize ( ); // this is full,who can I resize it. Error,, this is used to instantiate iterators for a listclass public class MyIterator<E> implementsIterable<E> { ....code }Explanation / Answer
//There is no error if E is defined as class,could you tell what is E in your case ? //Hope this will help you import java.util.*; class E { }; public class Test { public static void main(String[] args) { E[] array = new E[20]; // not error } }