About Question com.enthuware.ets.scjp.v6.2.65 :
Posted: Fri Jun 29, 2012 9:29 am
This is regarding the following question. I'm not sure why the link in the program goes to this post which seems to be about something else, but I'll post here anyway. Question:
com.enthuware.ets.scjp.v6.2.65
Consider the following two java files in /home/user directory:
//file A.java
package com.enthu;
class A
{
}
//file B.java
package com.foo;
class B
{
}
The files are compiled using the following command line:
javac -d /home *.java
Where will the class files go?
-------------------
The program says that "A.class in /home/com/enthu and B.class in /home/com/foo" is the correct answer. How can this be? The question says that the files are located in the /home/user directory, whereas the javac -d /home *.java command refers to the /home directory, thus the correct answer should be "No class file will be generated."
I understand the explanation of the -d command, but I've run a test and it does not recurse to subdirectories, at least on my Linux machine. Does it recurse elsewhere such as on Windows?
What is the correct answer?
Thanks for any tips.
com.enthuware.ets.scjp.v6.2.65
Consider the following two java files in /home/user directory:
//file A.java
package com.enthu;
class A
{
}
//file B.java
package com.foo;
class B
{
}
The files are compiled using the following command line:
javac -d /home *.java
Where will the class files go?
-------------------
The program says that "A.class in /home/com/enthu and B.class in /home/com/foo" is the correct answer. How can this be? The question says that the files are located in the /home/user directory, whereas the javac -d /home *.java command refers to the /home directory, thus the correct answer should be "No class file will be generated."
I understand the explanation of the -d command, but I've run a test and it does not recurse to subdirectories, at least on my Linux machine. Does it recurse elsewhere such as on Windows?
What is the correct answer?
Thanks for any tips.