Is this how Java package imports are supposed to work?

前端 未结 4 451
醉酒成梦
醉酒成梦 2020-12-21 08:34

I\'ve been struggling with my first regex. During the compile, Pattern and Matcher kept getting cannot find symbol errors.

I j

4条回答
  •  一生所求
    2020-12-21 09:19

    Yes, that is how package imports work (and are supposed to work) in Java. For example, doing import javax.swing.*; will import all classes within javax.swing.* but not sub-packages and their classes.

    Ergo, javax.swing.* will not import javax.swing.event or javax.swing.event.*

    Read the following blog for some friendly newbie advice.

提交回复
热议问题