×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Jun 2006
    Posts
    7

    about abstract base class

    I have a question like this:

    import javax.microedition.lcdui.game.*;
    //Layer is a abstract class, and paint is a abstract method in Layer;
    public class MyFirst extends Layer{

    public MyFirst()
    {
    /*why occured the error :
    Implict super constructor Layer() is undefined, Must explicitly invoke another constructor
    .*/

    }

    public void paint( Graphics g)
    {

    }

    }

    thank you for your help!

  2. #2
    Regular Contributor
    Join Date
    Jan 2005
    Location
    France, Paris
    Posts
    56

    Re: about abstract base class

    In your MyFirst constructor, you should have called super(with_the_right_attributes).
    But even doing this, it won't work, since you can't subclass the Layer class (given to the specs: "This [Layer] constructor is declared package scope to prevent developers from creating Layer subclasses"). But you can extend the TiledLayer (which extends the Layer class) if you wish.

  3. #3
    Registered User
    Join Date
    Jun 2006
    Posts
    7

    Re: about abstract base class

    Thank you for your help.

Similar Threads

  1. Replies: 2
    Last Post: 2005-11-10, 09:39
  2. Problem in NDS 3.0 for J2ME packager and abstract MIDlet base class
    By David Mitchell in forum Mobile Java Tools & SDKs
    Replies: 0
    Last Post: 2005-09-16, 19:30
  3. Replies: 3
    Last Post: 2004-07-16, 13:09
  4. Exceptions while loading application
    By avinash_rs in forum Mobile Java General
    Replies: 0
    Last Post: 2003-06-09, 10:53
  5. Abstract base class in a library
    By Mauri in forum Symbian
    Replies: 0
    Last Post: 2003-05-08, 14:08

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×