Two Laptop Bag
The moose likes Game Development and the fly likes Constructor not visible? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Game Development
Bookmark "Constructor not visible?" Watch "Constructor not visible?" New topic

Constructor not visible?

Vince Valentin

Joined: Feb 19, 2012
Posts: 19
Howdy folks.

Been a while since I been here. Trying to get back on the horse, as it were.

I am just getting into developing using LWJGL. I was messing around, trying out different things with the Display and DisplayMode classes and ran into an issue I have never seen before. I don't know if this is the proper forum, I didn't see one specifically for this library so I hope I'm ok posting it here. Any advice is, as always, much appreciated.

Jelle Klap

Joined: Mar 10, 2008
Posts: 1951

The default constructor is public by default, but when you add a constructor explicitly you have the choice of making it private, package private, protected or public. As far as I can tell from the API the only public constructor is the variant that takes two ints, which would make the invocation of the overloaded variant at line 49 illegal.

Build a man a fire, and he'll be warm for a day. Set a man on fire, and he'll be warm for the rest of his life.
Vince Valentin

Joined: Feb 19, 2012
Posts: 19
I see. Thank you for pointing that out, it's good to know. I am still wrapping my head around api documentation hehe I suppose I need to get more comfortable with that.

Thanks again!!
I agree. Here's the link:
subject: Constructor not visible?
It's not a secret anymore!