Re: New to OOP and polymorphism
From: Stephen (sedelblut_at_hotmail.com)
Date: 02/24/04
- Next message: nos: "Re: Inline bytecode?"
- Previous message: PlasmaDragon: "Re: Inline bytecode?"
- In reply to: Ryan Stewart: "Re: New to OOP and polymorphism"
- Next in thread: Ryan Stewart: "Re: New to OOP and polymorphism"
- Reply: Ryan Stewart: "Re: New to OOP and polymorphism"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 24 Feb 2004 00:32:20 GMT
> public void paint( Graphics g )
> {
> Shape2D aShape = new Circle( x, y, radius, fillColor );
> aShape.draw();
> }
>
> Like that?
Sorry, my mistake. What I meant was, what do I put in the Shape2D and in the
draw method class to make it draw on the JFrame client program using the
circle, square, and triangle classes - and any others I want to add later,
hence the whole idea object-oriented programming. Doing { public Graphics
draw() {} } does not work. Then in the client doing g.paint(
aShape.draw() ). ????? Anyone understand what I mean?
- Next message: nos: "Re: Inline bytecode?"
- Previous message: PlasmaDragon: "Re: Inline bytecode?"
- In reply to: Ryan Stewart: "Re: New to OOP and polymorphism"
- Next in thread: Ryan Stewart: "Re: New to OOP and polymorphism"
- Reply: Ryan Stewart: "Re: New to OOP and polymorphism"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|