dimanche 17 mai 2015
Was ist das für ein Konstrukt
Posted on 01:57 by verona
Hallo,
ich lese grad das Buch "Java ist auch eine Insel" von Christian Ullenboom und bin da auf eine merkwürdiges Konstrukt gestoßen:
Was bedeutet die erste Zeile?
Also das mit den Generics ist klar, und der Anfang "public final static" und dann die runden Klammern deuten ja auf eine Methode hin. Aber was soll dann die Konstante, der Konstruktoraufruf und die geschweiften Klammern mit ";" ?
ich lese grad das Buch "Java ist auch eine Insel" von Christian Ullenboom und bin da auf eine merkwürdiges Konstrukt gestoßen:
Code:
public final static Comparator<Person> PERSON_FIRSTNAME_COMPARATOR = new Comparator<Person>() {
@Override
public int compare(Person p1, Person p2) {
return p1.firstname.compareTo(p2.firstname);
}
};
Also das mit den Generics ist klar, und der Anfang "public final static" und dann die runden Klammern deuten ja auf eine Methode hin. Aber was soll dann die Konstante, der Konstruktoraufruf und die geschweiften Klammern mit ";" ?
Was ist das für ein Konstrukt
Categories: Was ist das für ein Konstrukt
Inscription à :
Publier les commentaires (Atom)
0 commentaires:
Enregistrer un commentaire