Real'sHowTo AddThis Feed Button
Custom Search

Handle the List conflictTag(s): Language


The List interface is declared in the java.util package and the List class is in the java.awt package. So if both import are defined in your source you won't be able to compile properly because this will cause a name conflict. The solution is to fully qualify the name used when you reference the List class or interface.
import java.util.*;
import java.awt.*;

...
java.awt.List myAwtList = new java.awt.List();
...

blog comments powered by Disqus


If you find this article useful, consider making a small donation
to show your support for this Web site and its content.

Written and compiled by Réal Gagnon ©1998-2013
[ home ]