Question: I need help reading generic types from any input in java. I would want to read all elements from any generic type and put them

I need help reading generic types from any input in java.

I would want to read all elements from any generic type and put them into an generic array in java.

Like for example if a user inputs a text file as an input on one instance of this class and a list of integers as an other input for another instance of the class.

I prefer not to use maps in java if possible.

Please explain in detail each step.

Thank you

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!