Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Braincramp regarding classes

 
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 )
 
Sheriff
Posts: 6450
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Moderator please close this thread...I accidentally posted before completing. I reposted above with complete code and questions. Thank you!
 
Ranch Hand
Posts: 1879
MySQL Database Suse
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
 
Wanderer
Posts: 18671
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Don't get me started about those stupid light bulbs.
    Bookmark Topic Watch Topic
  • New Topic