Results 1 to 2 of 2
  1. #1
    ai_2007 is offline Member
    Join Date
    Jun 2007
    Posts
    21
    Rep Power
    0

    Default Error while compiling

    Java Code:
    public abstract Component ();
    The above line of code is part of a class that I have created. But when I compile that class an error message pops up saying:

    invalid method declaration; return type required.,

    and the above line of code is highlighted.

    How do I resolve this?

  2. #2
    JavaBean's Avatar
    JavaBean is offline Moderator
    Join Date
    May 2007
    Posts
    1,270
    Rep Power
    9

    Default

    What do you want to do with that line? If it is a method declaration, you need to specify the return type as the error message says. To solve the problem, you should write something like this depending on the return type you have:

    Java Code:
         public abstract Component getMyComponent();

Similar Threads

  1. compiling trouble
    By capacitator in forum CLDC and MIDP
    Replies: 4
    Last Post: 06-10-2008, 10:12 PM
  2. Compiling error
    By lawksalih in forum New To Java
    Replies: 6
    Last Post: 01-29-2008, 07:26 PM
  3. I have 3 errors after compiling
    By coco in forum JDBC
    Replies: 2
    Last Post: 10-18-2007, 09:32 AM
  4. Error during compiling
    By boy22 in forum New To Java
    Replies: 2
    Last Post: 08-03-2007, 02:42 AM
  5. problems when compiling
    By valery in forum New To Java
    Replies: 2
    Last Post: 07-25-2007, 07:35 PM

Posting Permissions

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