Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7745579
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T10:03:36+00:00 2026-06-01T10:03:36+00:00

I have a Class(call it main class) and the method in main class calls

  • 0

I have a Class(call it main class) and the method in main class calls methods of other classes.I have extended this main class in all other classes like this

      public class Evaluate extends Main

in my main class i am using swingworker ,so i have written the code like this

      class Main extends SwingWorker<Void, Void>{
        public Main(GUI frame) {
        p = frame;

        }
        //some more code 

Now when i build this program, it gives me the following error

        error: constructor Main in class Main cannot be applied to given types;
        public class Evaluate extends Main {
        required: GUI
        found: no arguments
        reason: actual and formal argument lists differ in length

Here GUI contains the main method from where my application starts.Kindly help me why this error is occurring.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T10:03:37+00:00Added an answer on June 1, 2026 at 10:03 am

    When you extend a class, you should call a constructor of the main class in your own constructor (by using super). So in this case, your Evaluate class should look like

    public class Evaluate extends Main {
    
      public Evaluate( GUI frame ){
        super( frame );
      }
      // or another constructor
      public Evaluate( ){
        super( retrieveAFrameFromSomeWhere );
      }
      public Evaluate( loads of other arguments, GUI frame ){
        super( frame );
        //do something with the other arguments
      }
    }
    

    Check out the excellent Java tutorial for more information, and certainly the section about Subclass constructors

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The easiest implementation is when we call from single class main method other classes
I have two classes orchestrated by a main class and I would like to
I have small class called 'Call' and I need to store these calls into
In Visual Studio 2008 (C++) I have a class destructor (Let's call this class
I have a class that has two method in it, one calls a class
I have some classes with the same super-type. Therefore all of this classes have
Say you have a custom class call it Foo. When you then have an
In python, If I have a class foo , I can call foo.__module__ to
I have a template class that I serialize (call it C), for which I
I have created a separate class (let's call it class2.cs for example) and want

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.