Click to See Complete Forum and Search --> : JVM search...?


Mr. Ram
10-29-2006, 04:30 AM
I have some confusion in case of below question.
Any one..... pls give me brief explanation for this.


List
a. lib.jar
b. the standard Java class libraries
c. the 'current directory'
d. c:\libs\ant.jar
e. c:\libs\javacore.jar

Referring to the list above, given the classpath "c:\libs\ant.jar;c:\libs\javacore.jar;.", in what order will the JVM search for classes?

Choice 1 : b, d, and c
Choice 2 : d, e, and c
Choice 3 : a, d, e, and c
Choice 4 : b, d, e, and c
Choice 5 : b, a, d, e, and c

chazzy
10-29-2006, 08:29 AM
are you talking about the case where you have 2 of the same classes (maybe different versions, but essentially the same FQN) in the libraries?

while i have no idea what you mean by "a. lib.jar" and assuming that b. standards for the normal rt.jar, it'll be 4, unless you've changed the CP order in your JVM.

Mr. Ram
10-30-2006, 11:11 PM
I can't answer exactly to ur question. Bz, I got it from Brainbench certification test.

But, I know one thing. We can get these details with the help of -verbose option, while compile/run the java program.