Which class implements all the Connection Interfaces which are in javax.microedition.io package and how?
And in the same way which class implements the some of Collection interfaces like Iterator interface.
I saw a code: –
Iterator it;
ArrayList list = new ArrayList();
it = list.iterator();
The iterator() return type is “Iterator” which is an interface.
Please tell me what this code is doing is it returning an object of type Iterator? but as far as I know, interface can’t be initialized.
it = list.iterator();
here the iterator() method is returning an object which implements the iterator interface. This is built in feature provided by java.
In J2ME the Connection interfaces, like Bozho said,
javax.microedition.io.Connector is a factory class for all kind of connections. And the implementations of those interfaces are again built in feature.Regards,