Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
programmierung:interfaces [2025/09/26 13:37] – [Attribute] sweprogrammierung:interfaces [2025/12/20 14:53] (current) – external edit 127.0.0.1
Line 65: Line 65:
  
 Interfa Interfa
-ces verwenden das Schlüsselwort `interface`.+ces verwe 
 +nden das Schlüsselwort `interface`.
  
 Eine Klasse, die das Interface implementiert, verwendet das Eine Klasse, die das Interface implementiert, verwendet das
Line 76: Line 77:
 public interface Saeugetier{ public interface Saeugetier{
          
-    public boolean hatLunge = true; // Nur Deklarierung von Konstanten (public, static, final)+    // Deklarierung von Konstanten (public, static, final muss nicht explizit angegeben werden!) 
 +    // Wichtig: Muss initialisiert werden 
 +    public boolean HATLUNGE= true; 
  
     // Methoden ohne Implementierung     // Methoden ohne Implementierung