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


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Implementing interface in Class" Watch "Implementing interface in Class" New topic
Author

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.
Thomas.
[ edited to preserve formatting of error message -ds ]
[ August 12, 2002: Message edited by: Dirk Schreckmann ]
Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
try
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
Wanderer
Sheriff

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
 
Similar Threads
What is the Difference between Abstract class and Interface?
Why does this work? (apparent creation of an instance of an interface)
using interface as a type?
don't know how to handle different params in a command.
Observations & questions about Inner...