Set Iterator toString - JAVA -



Set Iterator toString - JAVA -

i'm doing assignment , within class, have set in order read multiple authors book class. i'm trying figure out how implement tostring. tostring normal , implement iterator such this:

public string tostring(){ iterator itr = set.iterator(); while(itr.hasnext()){ object element = itr.next(); } homecoming "book, isbn:" + isbn +", author:" + element }

does create sense?

first of all, have utilize same method signature of tostring, is:

public string tostring()

second, first line in implementation homecoming statement, renders rest of lines unreachable.

third, putting homecoming statement in loop debatable.

although not quite sure how want implement tostring, need alter these first.

java iterator set tostring

Comments

Popular posts from this blog

maven fortify plugin : Unable to load build session with ID XXXXX .. See log file for more details -

c# - Primavera WebServices does not return any data -

android - Display emoji panel with genymotion - keyboard/touch input? -