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
Go To First  |  Previous Question  |  Next Question 
 Core Java  |  Question 488 of 492    Print  
What's the difference between Object and "E"?
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?



  
Total Answers and Comments: 3 Last Update: August 05, 2008     Asked by: esekiel 
  
 Sponsored Links

 
 Best Rated Answer
Submitted by: ravikishore_gvr
 
Object is a class where as E is nothing but Generic Argument, While writing Generic Classes we will use type E.

Above answer was rated as good by the following members:
er.mukesh_208
July 15, 2008 01:08:34   #1  
srinivasa123 Member Since: July 2008   Contribution: 1    

RE: What's the difference between Object and "E"?
change the method name as next1() it wil work.
 
Is this answer useful? Yes | No
July 16, 2008 02:54:33   #2  
ravikishore_gvr Member Since: July 2008   Contribution: 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.
 
Is this answer useful? Yes | NoAnswer is useful 1   Answer is not useful 0Overall Rating: +1    
August 05, 2008 06:05:11   #3  
shishir11485 Member Since: August 2008   Contribution: 1    

RE: What's the difference between Object and "E"?
Object having a reference of one variable store in stack whereas "E" is created in a heap don't have a reference variable
 
Is this answer useful? Yes | No


 
Go To Top


 Sponsored Links

 




About Us  |   Privacy Policy  |   Terms and Conditions  |   Contact  |   Site Map  |   Add Question  |   Propose Category  |   RSS Feeds  |   Articles Sitemap  |   Site Updates  |   Add Resource

Copyright © 2005 - 2008 GeekInterview.com. All Rights Reserved
Page copy protected against web site content infringement by Copyscape