How to implement the abstract method in interface?

mix

Joined
Mar 27, 2011
Messages
1
Reaction score
0
I am wondering how to implement an abstract method in an interface. Given this interface:

Code:
    public interface Analysis
    {
        public double getAverage();
    }

To implement the abstract method, do I just declare the method as abstract?

Code:
    public abstract double getAverage();  ??
or declare the interface as abstract?

Code:
        public abstract interface Analysis
       {
          public double getAverage();
        }

Or are other things needed?


I have a class that implements the interface called `Marks`:



Code:
       public class Marks implements Analyzable
    {    some other code
         constructor
         mutators
         accessor
         public double getAverage();
    }


So, my main problem is How to implement the abstract method in interface?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,733
Messages
2,569,440
Members
44,832
Latest member
GlennSmall

Latest Threads

Top