Welcome to Software Development on Codidact!
Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.
Post History
Some development tools provide an error message when a user tries to import two things (classes, packages) with the same name. Some programming languages offer a syntax to import one of those thing...
#3: Post edited
Conflicting Imports in Java 8
- How can one import two classes with the same name in Java8?
Is there any way in Java 8 to import two classes with the same name? Eclipse gives a "The import foo collides with another import statement" error if I try to import two classes from different packages with the same name. For instance, Python allows `import foo from bar as foobar` to distinguish between classes with the same name. Does Java have anything similar?
- Some development tools provide an error message when a user tries to import two things (classes, packages) with the same name. Some programming languages offer a syntax to import one of those things under a different name. In Python, that syntax is `import foo from bar as foobar`. Does Java have an analogous construct for this?
#1: Initial revision
Conflicting Imports in Java 8
Is there any way in Java 8 to import two classes with the same name? Eclipse gives a "The import foo collides with another import statement" error if I try to import two classes from different packages with the same name. For instance, Python allows `import foo from bar as foobar` to distinguish between classes with the same name. Does Java have anything similar?