Java public class with public constructor with non-public parameter. Why? <p>Java allows to define the following pair of classes.</p> <pre><code>class Class1 { ... } public Class2 { public Class2(Class1 c1) { ... } } </code></pre> <p>Why Class2 has public constructor if I cannot instantiate it because Class1 is not accessible?</p> <p>For the record, there are no public classes that inherit from Class1.</p>