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ñez2 Answers
New Answerif 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(); }
Sololearn Inc.
535 Mission Street, Suite 1591Send us a message