Hi Team,
Im preparing for OCJP and in one of the sample question is below
Three version of MyClass.class exist on a file system
- /foo/bar/
- /foo/bar/baz
- /foo/bar/baz/bing
And the system class path includes
/foo/bar/baz
And this is the command invoked from /foo
java -classpath /foo/bar/baz/bing:/foo/bar MyClass
Which version will be used by java ?
The answer says : /foo/bar/baz/bing/MyClass.class
But how is this possible, the command should be invoked from above "foo" directory right ? if its invoked from foo directory then it wont find foo.bar.baz.bing.MyClass right ? Please throw some light on this answer.