class A and B are independently save at the folder named "myjava", when i add the "package" at the first line, class B can not compile and prompt the following message but class A can compile sucessfully:
B.java:3: error: cannot find symbol class B extends A{ ^ symbol: class A 1 error
//package myjava;
class A{
void funcA(){
System.out.println("A");
}
}
//package myjava;
class B extends A{
void funcA(){
System.out.println("B");
}
}
i wonder why adding the keyword "package" can not compile successfully.