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 8088195
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T19:00:57+00:00 2026-06-05T19:00:57+00:00

So I have a project in the Eclipse, with 2 classes, both of them

  • 0

So I have a project in the Eclipse,
with 2 classes, both of them contain an import of another library called Bucket.
Everything works perfectly, but in the third class I created, the import doesn’t seem to work and when I create new objects it says the constructor is undefined, while the code is similar among those 3 classes.

I’m sure it’s a silly Eclipse problem,
what can cause this?
Thanks

Edit – Here is the code:

This class works fine:

import java.util.*;
import unit4.bucketLib.Bucket;

public class Buck2
{
    static Scanner reader = new Scanner(System.in);
    public static void main(String [ ] args)
    {
        int n, i;
        System.out.println("Type a number of buckets to create");
        n = reader.nextInt();

        Bucket[] bucks = new Bucket[n];

        for (i = 0; i < n; i++)
            bucks[i] = new Bucket(20, "Bucket" + (i+1));

This class has errors:

import java.util.*;
import unit4.bucketLib.Bucket;
public class Buck3
{
    static Scanner reader = new Scanner(System.in);
    public static void main(String [ ] args)
    {
        int n, i;
        System.out.println("Type a number of buckets to create");
        n = reader.nextInt();

        Bucket[] bucks = new Bucket[n];

        double rdmcap, rdmfill;

        for (i = 0; i < n; i++)
        {
            rdmcap = (Math.random() * 10);
            bucks[i] = new Bucket(rdmcap, "Bucket" + (i+1));
            rdmfill = (Math.random() * rdmcap);
            bucks[i].fill(rdmfill);
        }
  • 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-05T19:00:59+00:00Added an answer on June 5, 2026 at 7:00 pm

    You should show the code that has the problem, but I can hazard a guess:

    Are you sure the import doesn’t work? Most of the time if it says the constructor is undefined it DID find the class you refer to (otherwise you’d get the error that the class isn’t found)

    Your call to the constructor probably doesn’t have the right parameters: if it expects an Integer, and you provide a String, it cannot find the constructor that asks for a String. Check your constructor-calls!

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

Sidebar

Related Questions

I have a library-only Android eclipse project (no main class, only library classes) that
I have a project in Eclipse and now I want to import another project
I have a project in Eclipse. When I run it from inside Eclipse, everything
I have a JavaME project in Eclipse (Pulsar 3.5; Galileo). I have another project
I have a library Eclipse project/workspace containing functionality that is occasionally delivered to a
I have a maven project in Eclipse which has as a dependency another project
I have a project (in Eclipse) which I've turned into an Android Project Library
I have two maven-based eclipse projects, one being a project with common classes and
I have a project in Eclipse with maybe 7 different classes that i open
I have this project on Eclipse 3.7 (Indigo) and planning to build the *.jar.

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.