Path: csiph.com!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Eric Sosman Newsgroups: comp.lang.java.programmer Subject: Re: Changing accessor on public static class Date: Tue, 6 Sep 2016 09:08:20 -0400 Organization: A noiseless patient Spider Lines: 27 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Tue, 6 Sep 2016 13:08:23 -0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="22e5ab429c5a4bb738666b9c52e40d69"; logging-data="13218"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/G1eROb+w7TK15O078FiNW" User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 In-Reply-To: Cancel-Lock: sha1:rApm4Nh4KKP561mAvlX+edr2lqc= Xref: csiph.com comp.lang.java.programmer:35545 On 9/6/2016 3:53 AM, mike wrote: > Hi, > > I use this class from another library like this: > > app.connect(new Configuration( ipAddress, username)); > > I tried to make class Configuration not public ( since I did not want to expose this name) and it can still be created. > Is there any point in making it Configuration class not public? I don't quite understand what you are doing. You show that the Configuration class is `static', which can only mean that it is a nested class embedded inside some other class: a top-level class cannot be `static'. You also show using `new Configuration()' to instantiate this class, which implies that the `new' must be in the containing class: if not, it would be `new Thing.Configuration()' instead. Yet you also say that the Configuration class belongs to "another library," implying that the `new' is not in the containing class at all but in some other class entirely. These three things cannot all be true simultaneously! Perhaps if you explained the situation in more detail, and cleared up some of the apparent contradictions, someone would be able to help. -- esosman@comcast-dot-net.invalid The Tooth Fairy has gone high-tech, now pays in Bitecoin.