Beispiel: Komplexe Zahlen I
class Complex
{ protected double re ;
protected double im ;
public Complex () {}
public Complex ( double real_part )
{ re = real_part ; im = 0.0 ; }
// Zuweisung an im eigentlich überflüssig, aber systematisch
public Complex ( double real_part, double imag_part )
{ re = real_part ; im = imag_part ; }
...
}
Vorherige Folie
Nächste Folie
Zurück zur ersten Folie
Graphik-Version anzeigen