wood burning stoves 2.0*
The moose likes Java in General and the fly likes problem with implementing interface 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 » Java in General
Bookmark "problem with implementing interface" Watch "problem with implementing interface" New topic
Author

problem with implementing interface

Tarun Kumar Agrawal
Greenhorn

Joined: Jun 29, 2011
Posts: 17
ImportJava.java:




Test.java:



On Compiling, i am getting following error:



What's wrong in the code? Thanks in advance..
Piyush Joshi
Ranch Hand

Joined: Jun 10, 2011
Posts: 207

did you read the error description, it clearly states that you are trying to assign weaker access privileges to methods while implementing them.

by default methods declared in interfaces have public access, when you implement an interface method it must be declared public.


Piyush
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: problem with implementing interface
 
Similar Threads
can we have private methods in an abstract class?
interface problem
Overriding Static Method Question
A question about interface methed.
Implementing interface in Class