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 Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Question with generics Please help" Watch "Question with generics Please help" New topic

Question with generics Please help

kartik krishnan
Ranch Hand

Joined: Nov 19, 2006
Posts: 63

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.

Jeanne Boyarsky
internet detective

Joined: May 26, 2003
Posts: 30130

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

I agree. Here's the link: http://aspose.com/file-tools
subject: Question with generics Please help
Similar Threads
Generic function
Question with generics
examulator question error
new to Hibernate DAO