Note that there are some explanatory texts on larger screens.

plurals
  1. POBeginner: Trying to have a class with an interface extend another class
    primarykey
    data
    text
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. COAs I have already told you in your previous question: Iterator should NOT extend GenericDictionary. There is no *is-a* association between both. You're abusing inheritance. If you want to access private members of your dictionary from your iterator, implement it as an inner class, as the standard JDK classes do.
      singulars
    2. CO@JBNizet And as I probably already mentioned ... I have no idea how. The JDK is just too dense for me. Your comment is of little help. I understand this is maybe not OK, however I need, for example: `.capacity()`. I cannot procede without it. Since my first class already exists ... my only other option is to pass it as a parameter, but that just seems non-intuitive or at the very least: wrong.
      singulars
    3. CODo you know what inner classes are? If not, google for "Java tutorial inner class", and you'll find a tutorial. As I told you already: highlight HashMap in your IDE and choose "View Source". Then go to the `iterator()` method definition, and you'll find an example implementation. Passing the dictionary as a parameter to the constructor of your iterator is a much much better solution than yours, and is in fact what an inner class implicitely does. So you could do that if you don't want to use an inner class.
      singulars
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload