For example I have this:
class A{
private int mine = 0; //Some field...
public A(int a){mine+=a; /*Some operation1...*/}
}
class B extends A{
private int mine = 0; //Some field...
public B(int a){mine-=a; /*Some operation2...*/}
}
and I get:
error: constructor A in class A cannot be applied to given types;
public B(int a){}
required: int
found: no arguments
reason: actual and formal argument lists differ in length
1 errors
I don't understand the error? What is telling me to do?
Though, the code works if Constructor of "A" has no arguments.
But I need to do the Operation1 (aka mine+=a;), so I need A's arguments, but then I fail.
I'm closed in this magic circle. What shall I do?
mine+=a;and not justmine = a;?