File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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

Win a copy of OCA Java SE 8 Programmer I Study Guide 1Z0-808 this week in the OCAJP forum!
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
It is sorta covered in the JavaRanch Style Guide.
subject: Implementing interface in Class