Follow along with the video below to see how to install our site as a web app on your home screen.
Anmerkung: This feature may not be available in some browsers.
abstract class MathLiteral{
private int x, y; // evtl noch "width, height"
public MathLiteral(int x,int y){
this.x= x;
this.y= y;
}
// Setter und Getter für x, y
public abstract void paint(Graphics g);
}
class Bruch extends MathLiteral{
private MathLiteral zaehler, nenner;
public Bruch(MathLiteral z, MathLiteral n, int x, int y){
super(x,y);
zaehler = z;
nenner = n;
}
@Override
public void paint(Graphics g){
zaehler.paint(g);
this.setY( this.getY() + 10);
g.drawLine(x,y, Math.max(zaehler.getWidth(), nenner.getWidth());
this.setY(this.getY() + 10);
nenner.paint(g);
}
Bestimmt.Gibt es sowas nicht schon fertig.
Und eines der besten Bsp für das Üben von OO-Programmierung mit Polymorphismus.Ist ja eine menge Arbeit.
Nein, aber wenn du es machen möchtest, dann kann es dir egal seinIch werde ja wohl nicht der erste sein, der das machen möchte