User Tools

Site Tools


Sidebar

Programming Reference/Librarys

Question & Answer

Q&A is closed







java:classes:extends

This is an old revision of the document!


extends

extends extends an already existing class with custom methods

package meine.mydate;
 
import java.util.Date;
 
/* 
 * extends Date = extends class java.util.Date 
 * java.util.Date must be importet 
 */
public class MyDate extends Date { 
 
    public int getFullYear() {
 
        return this.getYear() + 1900;
    }
 
 
 
// overrride the method getMonth from java.util.Date
 
    @Override
    public int getMonth() {
        return 99;
    }    
}
advertising
java/classes/extends.1366962699.txt · Last modified: 2013/04/26 09:51 by 88.75.157.182

Impressum Datenschutz