java - 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 packaged class"); } }
then import package containing class. can public constructor used though class not public? or need inside same package use it? couldn't try out myself because can't figure out how save package eclipse in classpath import it, if can out great. thanks
you can not access public constructor different package since class modifier default.
Comments
Post a Comment