I have a doubt in (packages) concept, i.e after we create our own package how to work with that package.Means how to import package, and make the classes in it work in some other class outside the package.
Some of the
I have a doubt in (packages) concept, i.e after we create our own package how to work with that package.Means how to import package, and make the classes in it work in some other class outside the package.
Some of the rules or look will depend on your environment. Essentially, each package exists in a folder bearing the package name. These packages can be nested, and as they are, their folders will show the same leveling. The source code for each file will reside in its folder.
For the most part, the packages that you create should have their source folders in the "src" folder of your Java environment. When compiled, their class files will be set up in the Java "classes" folder using the same folder structure.
You can import classes from package to package using the "import" command and the folder structure (from the "classes" level) followed by the class name. Normal rules of accessability apply. You can only access public methods from outside the package.