| advertise add site services publishers database health videos | ![]() | about toolbar stats live show health store more stuff JOIN/LOGIN |
Day Spa Packages - Mothers day spa packages - Day Spa Packages... visagemedispa.com | health and medical travel packages, medical travel packages, medical... mdinindia.com | Spa packages, facial packages, spa day, mom to be packages, couples healinghorizonsmassage.co... | Software - Health Club Management Software, Software for Fitness Clubs fastfunfitness.com |
A software package is used in object-oriented programming to name a group of related classes of a program. Packages are useful to measure and control the inherent coupling of a program. In a modular program, even outside object-oriented programming, a software package may refer to any component (module) that can be integrated into the main program. Typically this is done by the end user in a well-defined interface. In other contexts the integration must occur at source code level of a given programming language.
[edit] ImportAn example of a package is the java.io package which contains or groups together all the classes in the Java programming language that aid input and output of data, such as the buffered reader class which is used to accept user input from the keyboard. When a class is imported the user is free to use as if it were in their local directory. A single class can be imported like so: import java.io.BufferedReader; import java.io.FileReader; ... BufferedReader br = new BufferedReader(new FileReader("fooo.bar")); A user can also import all classes within a package by adding replacing the class name with a *. import java.io.*; ... BufferedReader br = new BufferedReader(new FileReader("fooo.bar")); [edit] Creating a packageCreating a package in java is as simple as placing related classes into one folder. The following package shows just how easy it is to create a package. Consider having a group of painter classes which include classes like fencePainter, housePainter, carPainter, etc. It would be nice to organize all of these classes into one package, which we will call painter. All that needs to be done is to place all of these classes into a folder called painter. Once that is done, place the following line at the top of each class. package painter; Packages can also be organized further by putting then in subdirectories. In the previous example the painter package can be put in a worker package, by making it a subdirectory of a folder called worker. Then the following line of code can be added to add a class to this package. package worker.painter; [edit] References
[edit] External links
|
| ↑ top of page ↑ | about thumbshots |