Hi<br>
ich will folgendes Problem lösen:<br>
Ein Klasse die eine Methode hat, welche 3 mal überschrieben wird, dann eine subKlasse, welche diese Methode nocheinmal überschreibt und dann beweist, dass alle 4 Versionen der Methode verfügbar sind.<br>
hier mein Code<br>
class Flower{
Flower(int i){<br>
System.out.println("Flower constr");<br>
}<br>
Flower(String s){<br>
System.out.println("String args");<br>
}<br>
Flower(String s, int i){<br>
this(99);<br>
this.s = s;<br>
System.out.println("Sring and int args");<br>
}<br>
}<br>
<br>
public class Blume extends Flower{<br>
Blume(int i){<br>
Flower f = new FLower("Hi");<br>
Flower f1 = new Flower(i + 9);<br>
Flower f3 = new Flower("Hello", 47);<br>
<br>
}<br>
public static void main(String[] args){<br>
Blume b = new Blume(7);<br>
}<br>
<br>
}<br>
Danke für eure Hilfe<br>
Othmar
ich will folgendes Problem lösen:<br>
Ein Klasse die eine Methode hat, welche 3 mal überschrieben wird, dann eine subKlasse, welche diese Methode nocheinmal überschreibt und dann beweist, dass alle 4 Versionen der Methode verfügbar sind.<br>
hier mein Code<br>
class Flower{
Flower(int i){<br>
System.out.println("Flower constr");<br>
}<br>
Flower(String s){<br>
System.out.println("String args");<br>
}<br>
Flower(String s, int i){<br>
this(99);<br>
this.s = s;<br>
System.out.println("Sring and int args");<br>
}<br>
}<br>
<br>
public class Blume extends Flower{<br>
Blume(int i){<br>
Flower f = new FLower("Hi");<br>
Flower f1 = new Flower(i + 9);<br>
Flower f3 = new Flower("Hello", 47);<br>
<br>
}<br>
public static void main(String[] args){<br>
Blume b = new Blume(7);<br>
}<br>
<br>
}<br>
Danke für eure Hilfe<br>
Othmar
Comment