lundi 23 décembre 2019

Get the name of the current class and create a txt with that name

Especially I need the program to create a text file. The name of the text file to be the class name.
I tried this but does not work:

String className = this.getClass().getName();
File file = new File("C:\\" + className + ".txt");




Aucun commentaire:

Enregistrer un commentaire