What About using import java.* for using all sub-packages under the package 'java'?

前端 未结 7 636
一生所求
一生所求 2021-01-13 19:06
import java.*;

Why cannot I do this importing ?? Instead of importing the all class in a particular sub-package of the package \'java\' , I tried t

7条回答
  •  庸人自扰
    2021-01-13 19:58

    It is not like what you think, consider when you want to use ChannelHandler interface you could do either import io.netty.channel.*; or import io.netty.channel.ChannelHandler; but you cant use import io.netty.*; and that why you cant import java.*;

提交回复
热议问题