When writing a Java project, you might use another mature Java class file, so how can you import the target class file into the project?
The following Operation.java are examples.
Now a Java file source code.
1. Open Eclipse, "File", "New", "Java project", enter the project name in project name, for example: Com.linwu. The other parameters use the default data. Click Finish
2. Under Project Com.linwu SRC, right click, select New->package, enter the package name in the Name field Com.linwu.
If the package name in the Operation.java file is: Packages Com.linwu; Enter Com.linwu, click Finish
3. Under the package, right click, select Import, select "File System" in "Gerneral", click Next
4. Select the directory where the files are located and select the Operation.java file. Click Finish to import the file.
Java Basic Learning--eclipse Importing a Java file