Skip to content

Intro to Reflection, Shallow Reflective Access code explanations unclear #279

Description

@authentictech

In Tutorials > Introduction to Java Reflection, Shallow Reflective Access section, I noticed that the explanation...

"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.

Activity

  1. authentictech commented on Sep 12, 2026

    @authentictech
    Author

    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.

    1. 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.
    2. method.invoke(null, pi) - Add an explanation that the null first argument is necessary when invoking static methods.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions