The constructor access modifier will be package-private (by default) . Since you declared the class public, it will be visible everywhere, but the constructor will not. Your constructor will only be visible in its package.
package flight.booking; public class FlightLog // Public access modifier { private SpecificFlight flight; FlightLog(SpecificFlight flight)
If you are not writing any constructor in your class, then the compiler generates a default constructor with the same class access modifier. In the following example, the compiler will generate a default constructor with the public access modifier (the same as the class).
package flight.booking; public class FlightLog // Public access modifier { private SpecificFlight flight; }
Sachin Gorade Apr 23 '13 at 9:03 on 2013-04-23 09:03
source share