name conflicts when importing packagesit is


Name Conflicts when importing packages

It is possible which you will try to import a package which contains classes in which have the similar name as a class in your own source code. In common you should try to prevent this, especially while the conflict is with a class in the java packages.

The two classes may or may not mean the similar thing. In common you should probably rename the class in your own source code rather than in the package. Therefore if the two classes with conflicting names are associated functionally, it might make sense to implement your class as a subclass of the class in the package.

There are a couple of name conflicts in the class library. The worst offenders are java.util.List and java.awt.List. The second worst offenders are java.sql.Date and java.util.Date, by this case is somewhat mitigated because java.sql.Date is a subclass of java.util.Date. If you requires to use one or both of the conflictingly named classes as well as importing the other package, you simply have to use the full package qualified name, inconvenient as it may be to categories.

Request for Solution File

Ask an Expert for Answer!!
JAVA Programming: name conflicts when importing packagesit is
Reference No:- TGS0284773

Expected delivery within 24 Hours