Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
    Bookmark Topic Watch Topic
  • New Topic

Braincramp regarding classes

 
David Crossett
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • Report post to moderator
I have an abstract class, MyShape, and want to derive a few classes from it - say MyLine, MyRect, and MyOval. MyShape looks a little like this:

Here is sample code for a SIMPLE MyLine object:
[code]
public class MyLine extends MyShape
{
public MyLine() //default constructor
{
super();
}
public MyLine( int x1, int y1, int x2, int y2 ) //regular constructor
{
super( x1, y1, x2, y2 );
}
public void draw( Graphics gg )
 
Jason Menard
Sheriff
Posts: 6450
  • Mark post as helpful
  • send pies
  • Report post to moderator
I'm not sure what your question is, but you probably want the following in Mfor draw() in MyShape:
public abstract void draw( Graphics gg );
 
David Crossett
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • Report post to moderator
Moderator please close this thread...I accidentally posted before completing. I reposted above with complete code and questions. Thank you!
 
Jamie Robertson
Ranch Hand
Posts: 1879
MySQL Database Suse
  • Mark post as helpful
  • send pies
  • Report post to moderator
David
you should be able to close your own topic by clicking on the close link beside the lower Post Reply button and above the "Contact Us" link.
Jamie.
 
David Crossett
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • Report post to moderator
It tells me only Moderators or Admins can do 'this function'.
If anyone is responding to this, PLEASE read this in full in the other thread under the same name!!!
thank you!
 
Jim Yingst
Wanderer
Sheriff
Posts: 18671
  • Mark post as helpful
  • send pies
  • Report post to moderator
Oops, I guess that's not something a regular user can do. You can delete your post, or edit it (which would've worked great here), but not move it. OK. Followup here then.
 
    Bookmark Topic Watch Topic
  • New Topic