Hi all I know it could be an easy question but i cannot solve the following issue. I have different .txt and I have different classes. I need to read a specific txt for each class. For that purpose I have a class which is used for reading the different txts but I need in each class to read the appropiate .txt.
Here is my example:
Here I read the txt and I say the txt I want to read:
public void currentQuestion(Context context, int cat) {
category = cat;
String questionFile = "";
Then in each class I need to read the especific txt.
For example in class car it would be String questionFile = “cars.txt”; and so on.
Thank you for your time
just use
getClass().getSimpleName()where ever you want to use the class name in your application