Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Compiler Says That My Class Is Not "public"!

 
JiaPei Jen
Ranch Hand
Posts: 1309
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a public interface OnlineUser.java and I have a public class OnlineUserImpl.java that implements the interface.

In my JSP, I created an instance of OnlineUserImpl with the OnlineUser type:

and later on in my JSP, I tried to:

I got an error message saying:

OnlineUserImpl() is not public in org.apache.artimus.authorization.OnlineUserImpl; cannot be accessed from outside package
OnlineUser onlineUser = new OnlineUserImpl();


Let me give my code for OnlineUser.java:

and my code for OnlineUserImpl.java:
 
Nathaniel Stoddard
Ranch Hand
Posts: 1258
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


Doesn't look public to me ...
 
Mighty Kush
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OnlineUserImpl() { }

I think that constructor needs to public.
 
JiaPei Jen
Ranch Hand
Posts: 1309
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I see. Thanks a lot.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic