no158
asked on
toString()
I'm trying to make a toString method that will mimic a Collection toString()
Looking for actual code of the method or code of the Collection toString()
Looking for actual code of the method or code of the Collection toString()
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I'm working with:
private LinkedList<AnyType> items;
public String toString() {
Iterator<AnyType> str = items.iterator();
return str;
}
I'm having a problem with incompatible types, where did I go wrong.
private LinkedList<AnyType> items;
public String toString() {
Iterator<AnyType> str = items.iterator();
return str;
}
I'm having a problem with incompatible types, where did I go wrong.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
:-)
You may download jdk source code from Sun.
http://www.sun.com/software/communitysource/j2se/java2/download.xml
Winfred Lu