java - Didn't declare abstract class but is saying can instantiate anyways? -
i'm getting error won't allow me instantiate class within method, because says abstract. however, didn't declare class abstract don't know why this. suggestions?
public class mytemps implements temperatures { public mytemps(string[] array) @override public listofstrings sublist(int fromindex) { if (fromindex>this.size()){ throw new indexoutofboundsexception(); } temperatures sub=new mytemps(10); } }
you can't instantiate interface, need do
new mylistofstrings(10);
Comments
Post a Comment