what is the default package and default class in java?
i checked on the internet but couldn't find a concrete answer. So please reply for my question.
what is the default package and default class in java?
i checked on the internet but couldn't find a concrete answer. So please reply for my question.
There's no such thing as "default class". "Default package" is another word for the "unnamed package" described in the Java Language Specification section 7.4.2
If you don’t explicitly package your classes or interfaces, In that case, they’re
packaged in a default, no-name package. This default package is automatically imported in
the Java classes and interfaces defined within the same directory on your system.
A class from a default package can’t be used in any named packaged class, regardless
of whether they are defined within the same directory or not.