i have a base class, a child class, an interface, and a child class that implements this interface
-base Abstract class Seq
public abstract class Seq {...some functions...}
-class For extends Seq
public class For extends Seq{
int first, last, step;
public For( int a, int b, int c)
{...some work on a,b,c }
}
till now, everthing is perfectly fine! i tested it.
public interface SeqIt {
public boolean function1();
public int function2();
}
-class ForIt that implements SeqIt (the interface)
the problem is the child class constructor
public class ForIt implements SeqIt{
public void ForIt( For x ) //here is the problem//
{...the work i wanna do...}
}
i have to call it from the main using this statement ForIt fi = new ForIt(new For(3, 8, 2));
so how should i write the constructor?
Your question isn’t very clear, but it looks like your problem is that you have
voidin your constructor signature.What you want is: