Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Question with generics Please help

 
kartik krishnan
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

i am a newbie and and I hope this is not a silly question. I have an implementation class which is in another class file ie there is an another public class. The interface was defined like this.





In the another Java file we have







The error returned is Can not instantiate the type User. I dont know how to resolve this . Can anybody tell me why I get the error? Waiting for a reply.

Thanks,
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 35757
412
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Kartik,
Can you post the class definition ("public class User") and constructor for the user class?

Some reasons I can think of:
- Is User an interface?
- Is User an abstract class?
- Does User lack a public constructor?
- Does User use generics like Foo does?
 
kartik krishnan
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
User is a plain bean. It goes like this

 
Cob is sand, clay and sometimes straw. This tiny ad is made of cob:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!