Download
Entwicklung
Konto
Download
Entwicklung
Anmelden
Vergessen Konto/Passwort
Konto erstellen
Sprache
Hilfe
Sprache
Hilfe
×
Anmelden
Anmeldename
Passwort
×
Vergessen Konto/Passwort
Übersetzungsstatus von Deutsch
Kategorie:
Software
Personen
PersonalForge
Magazine
Wiki
Suche
OSDN
>
Finden Software
>
System
>
Emulators
>
iModoki
>
Ticket-Liste / Suche
>
Ticket #531
iModoki
Beschreibung
Projekt Zusammenfassung
Entwickler-Dashboard
Web-Seite
Entwickler
Bildergalerie
RSS Feed-Liste
Aktivität
Statistiken
Historie
Downloads
Aller Releases-Liste
Statistiken
Quellcode
Quellcode-Repositorys-Liste
CVS
Repository ansehen
Ticket
Ticket-Liste
Liste der Meilensteine
Typenliste
Komponentenliste
Liste der zuletzt benutzten Tickets/RSS
Neue Ticket abschicken
Dokumente
Kommunikation
Foren
Forum-Liste
オープンディスカッション (9)
開発フォーラム (1)
Mailinglisten
Alle Mailinglisten
Neuigkeiten
Ticket #531
Ticket-Liste
Neue Ticket abschicken
RSS
インターフェースによる暗黙の abstract
Eröffnet am:
2002-08-31 13:07
Letztes Update:
2002-08-31 13:07
beobachte
ON
OFF
Auswertung:
ymakise
Verantwortlicher:
(Keine)
Typ:
Fehler
Status:
Offen
Komponente:
(Keine)
Meilenstein:
(Keine)
Priorität:
3
Schweregrad:
5 - Mittel
Lösung:
Keine
Datei:
Keine
Details
Antworten
public interface Interface {
public String hello();
}
public abstract class Super implements Interface {
public void sayHello() {
String msg = hello();
System.out.println(msg);
}
}
public class Test extends Super {
public String hello() {
return "hello, world";
}
public static void main(String[] args) {
new Test().sayHello();
}
}
というようなアプリケーションがあったとして、
ふつうに処理すると、Interface#hello() は参照されていな
いからという理由で削られてしまうが、
そうすると Super#sayHello() から呼ばれている hello()
(バイトコード上では invokevirtual test1/Super/hello()
になっている)は解決できなくなり、Super.class は不正な
クラスファイルになってしまう。
対処のし方は、Interface が結果の jar に含まれるものか、
そうでないものかによって変わってくる(はず)。
Ticket-Verlauf (0/0 Historien)
Dateianhangliste (
0
)
Dateianhangliste
Keine Anhänge
Bearbeiten
Kommentar hinzufügen
You are not logged in.
I you are not logged in, your comment will be treated as an anonymous post. »
Anmelden
Kommentar hinzufügen
Vorschau
Abschicken
public String hello();
}
public abstract class Super implements Interface {
public void sayHello() {
String msg = hello();
System.out.println(msg);
}
}
public class Test extends Super {
public String hello() {
return "hello, world";
}
public static void main(String[] args) {
new Test().sayHello();
}
}
というようなアプリケーションがあったとして、
ふつうに処理すると、Interface#hello() は参照されていな
いからという理由で削られてしまうが、
そうすると Super#sayHello() から呼ばれている hello()
(バイトコード上では invokevirtual test1/Super/hello()
になっている)は解決できなくなり、Super.class は不正な
クラスファイルになってしまう。
対処のし方は、Interface が結果の jar に含まれるものか、
そうでないものかによって変わってくる(はず)。