Class List vs Interface List
Question:
In the java class libraries I saw there is a class List (java.lang.Object,extended by java.awt.Component,extended by java.awt.List)
as wel as the interface List(java.util ). Suppose you have imported both into one class. If you declare a variabele of type List (e.g. List list ; ) What is the type of list then? The interface List of the class List? Or does this depend on the initialisation?
Re: Class List vs Interface List
You cannot import both. You'll have to explicitly specify the class of each variable used. Or import one and have to use the full qualified name for the other on every use
Re: Class List vs Interface List
I see, but how do you specify explicitly? Like this:java.lang.Object extended by java.awt.Component extended by java.awt.List List ?
Re: Class List vs Interface List
Code:
java.awt.List list = new java.awt.List();
Re: Class List vs Interface List