I have doubts regarding this:
x-|
| - FindBaz.class
|
| - test -|
|-Baz.class
|
|-myApp -|
|- Baz.class
public class FindBaz{
public static void main(String [] args) {new Baz();)
}
In the test directory
public class Baz {
static { System.out.println("test/Baz")}
}
In the myApp directory
public class Baz {
static { System.out.println("myApp/Baz")}
}
The current directory is x.
I wonder why
java FindBaz is incorrect statement.
Having no classpath specified on command line means that current directory and all its subderectories will be searched?
As a result Baz.class in the
test directory is the first found entry so "test/Baz" will be printed. Where I am wrong?