DEV Community

Saravanan B
Saravanan B

Posted on

Core Java - Packages

Packages
In java packages are used to structure the code in the folder.

A class inside same package can access the Static method directly and non-static method by creating object for it.

A class outside the package can access by importing the class from package.

If 2 classes in different package as same name even if we import class still it points to the class in the same package.
To call package 1 class package1.classname.method .

Top comments (0)