wood burning stoves
The moose likes Beginning Java and the fly likes Implementing interface in Class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Implementing interface in Class" Watch "Implementing interface in Class" New topic

Implementing interface in Class

Thomas Markl
Ranch Hand

Joined: Mar 08, 2001
Posts: 192
Implementing interface in Class
What did I wrong?

Thanks for your answers.
[ edited to preserve formatting of error message -ds ]
[ August 12, 2002: Message edited by: Dirk Schreckmann ]
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
public interface blabla{}
cause default modifier is only accessable for a package. And your class was public.
I think this caused the error
Jim Yingst

Joined: Jan 30, 2000
Posts: 18671
No, the interface may have default (package) access. This isn't a problem. However, inside an interface, all methods are implicitly public (i.e. even though they may not be declared as public). Thus when you implement the methods in a class, the implementing methods must be public as well. And inside a class, you must explicitly declare a method to be public, in order to make it so.

"I'm not back." - Bill Harding, Twister
I agree. Here's the link: http://aspose.com/file-tools
subject: Implementing interface in Class
It's not a secret anymore!