java - How to implement the abstract method in interface? -


I am thinking how to implement an abstract method in an interface. Looking at this interface:

  public interface analysis {public double getAverage (); }   

In order to implement an abstract method, do I declare the method as intangible?

  public abstract double getAverage (); ??   

Or declare the interface as an abstract?

  Public abstract interface analysis {public double getAverage (); }   

Or need other things?

I have a class that implements the interface called sign :

  marks of public squares apply (some other code) Manufacturer mutator public double getAverage ();}   

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

< Div class = "post-text" itemprop = "text">

To create an intangible class implementing the interface:

  Public abstract class AbstractAnalysis Applies analysis {public abstract double getAverage ();}   

to create a solid square to implement the interface:

  public class mine Analysis applies {public double getAverage () {// TODO}}   

Or, it increases the intangible class to create a solid square and thus the interface is implemented:

  Public class MyAnalysis offers AbstractAnalysis {public double getAverage () {// TODO}}    

Comments

Popular posts from this blog

qt - switch/case statement in C++ with a QString type -

python - sqlite3.OperationalError: near "REFERENCES": syntax error - foreign key creating -

Python's equivalent for Ruby's define_method? -