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

formatting - SAS SQL Datepart function returning odd values -

c++ - Apple Mach-O Linker Error(Duplicate Symbols For Architecture armv7) -

php - Yii 2: Unable to find a class into the extension 'yii2-admin' -