Quote:
Originally Posted by rudun
The issue I am having now is that it is not building becasue it needs a constructor, but if I am inheriting the class shouldn't they already exist.
|
In this case you need to explicitly define at least one constructor for your subclass (fps).
Why? Because if you don't specify a constructor in a subclass, Java makes a default one for you that doesn't take any arguments. But that default no-argument constructor expects to call the no-argument constructor for all of the superclasses (CANJaguar in your case). CANJaguar doesn't have a no-argument constructor, only the two constructors CANJaguar(int, ControlMode) and CANJaguar(int). That's what the compiler error message is telling you - that CANJaguar has "no suitable constructor" for a default no-argument subclass constructor to call.
So you need to do something like this:
Code:
public class fps extends CANJaguar {
public fps(int id) throws Exception {
super(id);
}
...
}
Hope that helps!
- Ron
Team #2607 controls mentor