You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Intro to Reflection, Shallow Reflective Access code explanations unclear #279
"We are going to take a List of items and then search through the Collections class to see whether we can find any methods that we can give the method to."
...the part at the end "we can give the method to" is not correct. It is not a method that is being given to the other methods, it is a List object.
I also think that there are a couple of lines in the code example that could do with an explanation even if it is not totally pertinent to reflection. After all, as a tutorial mainly for beginners, not everything is obvious and a little additional learning beside the main topic is appreciated.
map(i -> i - '0') - I think it needs a comment explaining that this is a way to translate a char code point to the char's equivalent int value.
method.invoke(null, pi) - Add an explanation that the null first argument is necessary when invoking static methods.
Activity
authentictech commentedon Sep 12, 2026
I also think that there are a couple of lines in the code example that could do with an explanation even if it is not totally pertinent to reflection. After all, as a tutorial mainly for beginners, not everything is obvious and a little additional learning beside the main topic is appreciated.
map(i -> i - '0')- I think it needs a comment explaining that this is a way to translate acharcode point to thechar's equivalentintvalue.method.invoke(null, pi)- Add an explanation that the null first argument is necessary when invoking static methods.