
idea勾选这个是自动导包(默认是自动导包,这样设置:将导包语句注释之后,还会自动给你补充导包语句)

package com.itheima.d1_package;import com.itheima.d1_package.it.Student; // 会自动导包import com.itheima.d1_package.it.Student;public class Test {public static void main(String[] args) {// 目标:理解以下两点// 1.同一个包下的类,互相可以直接访问System.out.println(User.onlineNumber);// 2.不同包下的类,必须先导包才可以访问Student s = new Student();// 3.如果这个类中使用不同包下的相同类名// 此时默认只能导入一个类的包,另一个类要使用全名访问com.itheima.d1_package.it2.Student s2 = new com.itheima.d1_package.it2.Student();}}
