Can a public constructor built inside a friendly class be accessed from a
different package?
package mypackage.pack1;
class PackClass {
public PackClass() {
System.out.println("I'm creating a packaged class");
}
}
then import the package containing this class. Can the public constructor
be used even though the class is not public? Or do i need to be inside the
same package to use it? I couldn't try it out myself because I can't
figure out how to save the package with eclipse in my ClassPath to import
it, so if you can help out with this too it would be great. Thanks
No comments:
Post a Comment