It depends on what kind of project you are doing.
I wouldn’t recommend to have the question in the code, as it can get complicated and messy with if there is a large amount of questions.
File work good, but wouldn’t recommend doc format, a plain “.txt” format is easier to code with.
Database also works, however if the test system will be used for “real” then the internet on the test device might be turned off, which will result in no communication with the database
//Galin
solved Where should questions be stored for a test engine in Java