posted 1 year ago
This question in my opinion is badly constructed for the next reason: it doesn't say anything about your 'present working directory'.
So the possible answers per my understanding are: A, C and D
A would be correct if you'd be at '/' directory
C would be correct if you'd be at '/programs/' directory
D would be correct if you'd be at '/programs/mine/' directory
So the possible answers per my understanding are: A, C and D
A would be correct if you'd be at '/' directory
C would be correct if you'd be at '/programs/' directory
D would be correct if you'd be at '/programs/mine/' directory
Kelvin Okornoe
Ranch Hand
Posts: 58
2
Kelvin Okornoe
Ranch Hand
Posts: 58
2
posted 1 year ago
In my opinion, there are just too many assumptions to this question.... but, I guess it is acceptable. First, you have to assume that the classpath is not set -- neither the environment variable or the -cp switch. This means that the classpath is the default (current) directory. And since you are compiling from the programs directory, the classpath is the "programs" directory.
Second, you have to assume that you are following the norm in compiling -- not using the source or target switches of the compiler.
Given these assumptions, the answer is option C -- as that would be the best location to compile, based on that package.
Henry
-
2
-
-
-
-
Kelvin Okornoe wrote:
Please how does the phrase ".....if we compile from programs" change the answer to the question.
In my opinion, there are just too many assumptions to this question.... but, I guess it is acceptable. First, you have to assume that the classpath is not set -- neither the environment variable or the -cp switch. This means that the classpath is the default (current) directory. And since you are compiling from the programs directory, the classpath is the "programs" directory.
Second, you have to assume that you are following the norm in compiling -- not using the source or target switches of the compiler.
Given these assumptions, the answer is option C -- as that would be the best location to compile, based on that package.
Henry
posted 1 year ago
If you're in programs directory currently, then what you see (being in "programs") is:
.../mine/whiz/Fan.java
So, package statement needs to reflect that directory structure.
-
1
-
-
-
-
Kelvin Okornoe wrote:
Liutauras Vilda wrote:
If it says that, then answer is CPatrickAlex Silva wrote:The question acctually says "...if we compile from programs?"
Answer A
Please how does the phrase ".....if we compile from programs" change the answer to the question.
If you're in programs directory currently, then what you see (being in "programs") is:
.../mine/whiz/Fan.java
So, package statement needs to reflect that directory structure.

Hey! Wanna see my flashlight? It looks like this tiny ad:
Thread Boost - a very different sort of advertising
https://coderanch.com/t/674455/Thread-Boost-feature
|