Remember that you break data encapsulation by using this modifier. All nonabstract classes that derive from the class containing one or more abstract methods must implement all abstract methods. Methods allow you to set or get information about the current state of the object. In the example class above, you would want the class to support methods to get and set the xPosition and String fields within the class. When a method is final , it means subclasses can't override or hide the method.
Methods can return one value.
This means that you can write a Get type of method that returns the xPosition, or you can return an error value. Consider the code below that implements a couple of simple methods, getPosition and putPosition , on the class shown above, OurApplet . The new class, called the derived class, inherits its parent's state and methods. When you implement a derived class, you do not need to change or to have the source code for the base class. All Java classes implicitly derive from the Object class, and applets derive from the java.applet.Applet class.