Professional Documents
Culture Documents
Defining Classes
Defining Classes
Class Definitions
Encapsulation
Overloading
Constructors
data2
method2
Programmer
data
who
method1
method3 method uses the
class
method4 data3
Program
Lập trình Java
ENCAPSULATION(2)
public & private
all instance
variables private
private data1
accessor
public method
different
parameter list
Signature
computeSomething(int,double,double,String)
Cannot Overload
Based on the Type
Returned
You must not create any library, if you use the same workspace.
Option 1: Just use the source
In the properties of the project which has the dependencies you can add another
source-folder:
Properties > Java Build Path > Tab: Source > Add Folder...
In the Project Tab you can "add" the whole project to the other project, too. There
are many ways to achieve your goal.
Option 2: Create and add the library to the Build-Path
Adding an existing Jar (your own library):
If it is in the workspace:
Properties > Java Build Path > Tab: Libraries > Add JARs...
If it is somewhere on the drive:
Properties > Java Build Path > Tab: Libraries > Add External JARs...
Exporting a source folder as a library:
Context Menu of Source Folder > Export > Jar File
There are two types: Executable Jars and "normal" Jars. You don't need an
executable Jar.