GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

  GeekInterview.com  >  Interview Questions  >  J2EE  >  Core Java

 Print  |  
Question:  What's the difference between Object and "E"?

Answer: I'm trying to write an Iterator class for a LinkedList class that I wrote.
One of the methods is "public E next()"
I try to return an "E" but eclipse says "cannot convert from Object to E".
How do I fix this?


July 07, 2008 02:54:33 #2
 ravikishore_gvr   Member Since: July 2008    Total Comments: 1 

RE: What's the difference between Object and "E"?
 
Object is a class where as E is nothing but Generic Argument, While writing Generic Classes we will use type E.
     

 

Back To Question