1 package
2 类似于文件夹
3 在某个包下面新建的文件,会自动在开头的部分添加package说明
4 在不同的包之间,移动文件,也能自动更新头部的package说明
// 1. 导入一个类
// import tools.A
// 2. 导入多个
// import 包名.{类1, 类2 ... }
// import tools.{B, C, Student}
// 3. 导入一个包下所有的类 包名._
import tools._
// 4. 导入之后重新命名 格式:(类名=>新名字)
import tools.{Student => NewStudent}
import tools.art.Student
object demo02 {
def main(args: Array[String]): Unit = {
new A()
new B()
new C()
var s1 = new NewStudent()
s1.test()
}
}