JDK中主要的包
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/7fc88ba97f09baf1984e263ee54b393e.png#pic_center)
导入包
无重名
package com.ssc.test2;
import com.ssc.test1.*;
public class Test2 {
public static void main(String[] args) {
Test1 uTest1 = new Test1();
uTest1.sscMethod();
}
}
有重名记得写全名导入
com.ssc.test1.Test1 uTest2 = new com.ssc.test1.Test1();
uTest2.sscMethod();
导入静态属性和方法
import com.ssc.test1.*;
import static com.ssc.test1.*;
public class Test2 {
public static void main(String[] args) {
Test1 uTest1 = new Test1();
uTest1.sscMethod();
com.ssc.test1.Test1 uTest2 = new com.ssc.test1.Test1();
uTest2.sscMethod();
uTest2.sscMethod1();
System.out.println(uTest1.age);
}
}