Closed lhy-hoyin closed 12 months ago
I think as long as the imported method name doesn't conflict with any method name within the class, it's fine to use import static... I also wonder when will one choose one over another 🤔
The reason I can think of is that import static could be used as a shorthand for constants and methods that are used many times within the class you are working with.
agree, i think import static is mostly used to access static members (constants, etc) of other classes/interfaces, so it's up to you which one you prefer
Is there a preference/rule/standard on when to use
import xxx
vs when to useimport static xxx.yyy
?For example, in
AddCommandTest
I believe that if
import seedu.address.testutil.Assert
is used instead, then the test would look like this