1.using packaged class in non-packaged or packaged class: Need to use import.
2.using non-packaged class in non-package class : can be present in same directory. Else if different directory, should be available from classpath. No need(and can't) to use import.
3.using non-packaged class in packaged class: not possible at all(since the non-packaged class name mentioned in packaged class will be interpreted as belonging to the pacakged class's package and so the compiler will take this class as package.class and so will report wrong class file.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment