wood burning stoves 2.0*
The moose likes Java in General and the fly likes Question with generics Please help Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Question with generics Please help" Watch "Question with generics Please help" New topic
Author

Question with generics Please help

kartik krishnan
Ranch Hand

Joined: Nov 19, 2006
Posts: 63
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
internet detective
Marshal

Joined: May 26, 2003
Posts: 30076
    
149

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?


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
kartik krishnan
Ranch Hand

Joined: Nov 19, 2006
Posts: 63
User is a plain bean. It goes like this

 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Question with generics Please help
 
Similar Threads
Generic function
Question with generics
examulator question error
new to Hibernate DAO
jdk1.6