Quote:
Originally Posted by LFRobotics
Ok AWESOME - now this may seem like a dumb question to you but im a beginner programmer so here it is
How exactly do I extend the Joystick class - I tried it like this:
Code:
public class XBox extends Joystick {
}
but Netbeans doesn't like that
When you say
do you want that in the class and would that just look like
THANKS for all your help!
|
That is the correct way to extend a class. The compiler is most likely complaining about the missing constructor. Anything that extends the Joystick class is required to have a constructor that calls the Joystick(int port) constructor. So your constructor will look like this inside of your class:
Code:
public XBox(int port) {
super(port);
}
The super() method will call the super class's (Joystick) constructor.