Win a copy of Functional Reactive Programming this week in the Other Languages 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: 34973
379
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

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic