This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Java in General and the fly likes problem with implementing interface Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Java in General
Reply 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
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: problem with implementing interface
 
Similar Threads
A question about interface methed.
Implementing interface in Class
interface problem
can we have private methods in an abstract class?
Overriding Static Method Question