Thank you guys for the answers, i will experiment a little bit with it!
Thanks for the ideas!
--- Update ---
Or is it possible to write a code that modifies the code itself?
(and anyways I came to the thing, that a create simple files instead of objects, so the problem is now: how to open a file with a string?)
So i imagine it like this:
i have txt files like car.txt, house.txt etc...
String result;
prozess gives a value to result
and here it would be great to have a command which would implement the text i give in into the program itself to the next line like:
write.programitslef("Scanner " + result + "Scanner = new Scanner (new File ("" + result + ".txt"));")
So if you run it, after you have for example 'car' for the String, to code writes to itself:
Scanner carScanner = new Scanner (new File ("car.txt));
so i could reach the stored information in the actual file, without knowing it in advance which i'll need
--- Update ---
i mean:
Scanner carScanner = new Scanner (new File ("car.txt"));