Interfaces questions | Sololearn: Learn to code for FREE!

-1

Interfaces questions

I have problems implementing the methods of an interface to my main class, how can i fix it? https://code.sololearn.com/ckqrXEFlqWc3/?ref=app

4/6/2017 11:00:03 AM

carlos nuñez

2 Answers

New Answer

+6

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(); }

+2

override all the methods of the interface.