So here's my situation, I have a generic class called:
public class SortsTestController<T extends Comparable<T>>
Later in the code in order to grab the correct text file, I need to check whether type T is an Integer or a String. I know in C# an easy way to do this is just to do typeOf(T), but to my dismay there seems to be no easy way to do this in Java. Since I'm relatively new to coding, could someone give me a simple work around? Every post I've found mentions type erasure and reflection n' stuff like that and doesn't give a clear solution, and I can barely follow. I just need a simple solution that works.
In case this helps here's what I'm trying to do:
if (T is an Integer)
file += "Int.txt";
else
file += "Str.txt";