Results 1 to 3 of 3
  1. #1
    emceenugget is offline Senior Member
    Join Date
    Sep 2008
    Posts
    564
    Rep Power
    7

    Default constructor ... is not visible

    Hi, this is my first post on these forums, so thanks in advance for any help in this topic and in the future. Hopefully I can contribute to other topics as well. And hopefully this is the appropriate section of the forum to post this question in. Anyways...

    I created a .jar containing Card and Deck classes. They are public classes, not abstract, and i did not make the constructors private. I am now creating a
    Table class (amongst others) that must create a deck in its constructor, but I get "The constructor Deck(int) is not visible."

    I am actually able to manipulate Deck and Card objects, just not instantiate them. Any answers? Should I provide certain parts of my code? (I didn't wanna cut and paste unnecessary stuff.)

    Thanks again.

    EDIT: If it helps, I'm using Eclipse to do this. It's also my first time using Eclipse.

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    Hm, you say that you didn't make the constructors private, but did you make them explicitly public? If not then they will not be visible outside of the package.

  3. #3
    emceenugget is offline Senior Member
    Join Date
    Sep 2008
    Posts
    564
    Rep Power
    7

    Default

    Ooooh. I didn't know that it's only implied public within the package. Thanks a lot, it works now. It was really getting on my nerves and I thought I messed up importing.

Similar Threads

  1. Replies: 2
    Last Post: 04-14-2009, 10:01 PM
  2. How do you keep multiple popups visible?
    By Jacob Abernathy in forum New To Java
    Replies: 6
    Last Post: 09-15-2008, 06:35 PM
  3. Replies: 0
    Last Post: 08-04-2008, 12:17 PM
  4. Replies: 0
    Last Post: 12-19-2007, 09:10 AM
  5. Replies: 0
    Last Post: 12-19-2007, 09:01 AM

Posting Permissions

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