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
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

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.
 
It's exactly the same and completely different as this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
    Bookmark Topic Watch Topic
  • New Topic