0

I have a simple text input console. I am trying to write a set of global commands to get information about objects. I am trying to refer to the objects using the string that the user inputs. For example, if the user inputs "getItemId stick" the program would use the object method stick.getItemId() to get the item ID and pass it back to the console. I want to use str.getItemId but of course java will not allow this as str is a string and not an item object. Is there a library I can use to convert the string into the object name so that I can do this?

The purposed solution to this issue is referring to using a string to control what method is being used rather than what object is being used.

CNorlander
  • 327
  • 3
  • 12

0 Answers0