-1

我想将我朋友为他的项目创建的包导入到我的项目中。我应该怎么做才能导入那个包。我是否必须创建库文件并将其包含在我的项目中?

4

3 回答 3

0
import   <the complete package name>

喜欢

import java.util.LinkedList;
import java.util.Queue;

如果你想做静态导入:

import static java.lang.Math.PI;

您还需要些别的吗?

于 2013-10-05T22:27:00.047 回答
0

You have to add the external jars in the classpath and then you will be able to import the classes they provide.

import fully.qualified.class.name.from.external.jar.ClassName;
于 2013-10-05T22:29:08.723 回答
0

packagee 行应该是你程序的第一行。如果要加载所有包类,请使用下面的行。

import packagename.*;

如果你想导入单类包使用

import packagename.classname;
于 2013-10-05T22:33:57.943 回答