Link to home
Start Free TrialLog in
Avatar of no158
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()
SOLUTION
Avatar of CEHJ
CEHJ
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of winfred_lu
winfred_lu

dear no158,

You may download jdk source code from Sun.
http://www.sun.com/software/communitysource/j2se/java2/download.xml

Winfred Lu
Avatar of no158

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.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
:-)