christophe Leconte wrote:I don't understand why the only valid response is D.
For example if I replace "INSERT CODE HERE" by package my.directory.name.A; and I launch the command : javac ./named./A/Bird.java. I have no compilation error.
Strictly speaking you are correct: you can insert any of those package statements and the code will compile successfully. But the question is clearly testing your knowledge about package statements. So from the naming of the current directory (/my/directory), you should know that my.directory can't be a part of the package statement (and therefore B can't be a correct answer).
In such a question it's very important to be aware of the "context of a question". This question only has answer options with package statements and in the question itself the directories where the Java source code file resides and from where the source code file will be compiled is the same, so it's clearly about choosing the most appropriate answer. In this thread you'll find a nice discussion about this "context of a question", it's definitely worth reading.
In this topic you'll find a discussion about exactly the same review question.