This site requires JavaScript, please enable it in your browser!
Greenfoot back
Zamoht
Zamoht wrote ...

2013/10/8

Subclass of GreenfootImage

Zamoht Zamoht

2013/10/8

#
Is it possible to subclass the GreenfootImage class or should I just implement it?
davmac davmac

2013/10/8

#
Is it possible to subclass the GreenfootImage class
Why not just try it? ;)
or should I just implement it?
I'm not sure what you mean by that.
Zamoht Zamoht

2013/10/8

#
I have tried to subclass it, but it gives me an error. Something about GreenfootImage being an abstract class. By implementing I mean writing this: public class MyImage implements GreenfootImage instead of: public class MyImage extends GreenfootImage
Zamoht Zamoht

2013/10/8

#
Oh never mind.. I don't get why I couldn't make it work last time I tried. I ended up writing the following and it works fine. public class MyImage extends GreenfootImage { public MyImage(int width, int height) { super(width, height); } }
You need to login to post a reply.