Interfaces questions | Sololearn: Learn to code for FREE!


Interfaces questions

I have problems implementing the methods of an interface to my main class, how can i fix it?

4/6/2017 11:00:03 AM

carlos nuñez

2 Answers

New Answer


if implement an interface you must override ALL the methods of the interface PROPERLY If the method in the interface has an int parameter, then you also need to override that method with an int parameter public class NMG implements Aritmetic { //did not have parameter as the interface @Override public void Suma(){ int n; } //did not override Prod and Per10 which is a must } public interface Aritmetic{ public NMG Suma(NMG n); public NMG Prod(NMG n); public NMG Per10(); }


override all the methods of the interface.