– a hexadecimal digit can represent 4

– a hexadecimal digit can store 16 values (

4 bits can represent a maximum of 16 decimal values too. So:

1 hexadecimal digit = 4 bits = 16 decimal values. ]]>

I have a question because you first say:

“you will quickly notice that the maximum value a hexadecimal digit can store is equal to exactly the maximum number 4 bits can store.”

“On the other hand, since one hexadecimal digit can represent 4 bits, that means that we can represent a byte (8 bits) using only 2 hexadecimal digits, instead of 8 separate bits.”

but then you say:

“On the other hand, since hexadecimal digits can store 16 values, from 0 to F, they can be used to store 2 bytes per each digit, because 16 can be divided by 8, which is the number of bits a byte has.”

so my question is: which one is the correct? a hexadecimal maximum value is 4 or is 16?

]]>I don’t think custom iterators were explained so that you can actually use them in production, the motivation for that certainly doesn’t come to mind now, but more so that people don’t continue to deal with “magic”. Magic is dangerous and offensive to programmers (or should be). Therefor, it is more an explanation of what really happens and how things work, when they might appear to be… magic. ðŸ™‚ ]]>

But anyone confused about where we would use the customer Iterator here, “GenericIterator”.

It should be in the generic version of GetEnumerator method in the GenericList class.

public IEnumerator GetEnumerator()

{

return new GenericIterator(this);

}