This week's book giveaway is in the Agile and other Processes forum. We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line! See this thread for details.
cannot find symbol -the subclass and supercalss are in the same directory
zhy guo
Greenhorn
Joined: Aug 21, 2005
Posts: 3
posted
0
1.all the files are in the folder" I:\my codes\food\"
2.soure files:
1)B.java
package food;
public abstract class B extends Abc{
abstract void exit();
}
2)Abc.java
package food;
public abstract class Abc{
abstract void doit();
abstract void test();
}
3.before compile class B,class Abc is compiled successfully。then when trying to compile class B ,error raise :
b.java:3: cannot find symbol
symbol: class Abc
public abstract class B extends Abc{
^
1 error
John Jai
Bartender
Joined: May 31, 2011
Posts: 1778
posted
1
Try javac *.java
zhy guo
Greenhorn
Joined: Aug 21, 2005
Posts: 3
posted
0
Thanks John Jai.
It work! But why....
John Jai
Bartender
Joined: May 31, 2011
Posts: 1778
posted
0
You have to consider the package structure when you compile and run.
So alternative way (or the correct one) is to compile like below -
John Jai wrote:You have to consider the package structure when you compile and run.
So alternative way (or the correct one) is to compile like below -
Where food directory is present under C:/test
Yes, this is preferred way when you compile particular file.
and john mean while we can do using *.java if you go to the root package/food . I am curious to know the behind the sense of *.java even here also compiler have to do linking right?
John Jai
Bartender
Joined: May 31, 2011
Posts: 1778
posted
0
The listing for "Compiling multiple source files" here just tells that the wildcard option compiles all source files in the specified directory. I just copied the two source files in a different directory (not the directory 'food' with package name) but still was able to successfully compile them using * option.