aspose file tools*
The moose likes Beginning Java and the fly likes can you help me please?: error whtih inheritance Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "can you help me please?: error whtih inheritance" Watch "can you help me please?: error whtih inheritance" New topic
Author

can you help me please?: error whtih inheritance

Engin Okucu
Ranch Hand

Joined: Feb 09, 2002
Posts: 174
I tried to compile but i always have the same error. I have 2 class in the same package,one abc and the other is def ; Here you can see my class :
public class abc {
public abc(){}
}

public class def extends abc {
public static void main(String arg[]) {
System.out.println("compiled and executed");
}
}

I have this error:

def.java:1: cannot resolve symbol
symbol : class abc
location: class def
public class def extends abc {
^
1 error
Can you answer please.....thanks a lot!
Rob Ross
Bartender

Joined: Jan 07, 2002
Posts: 2205
Are both .java files in the same directory?
How are you compiling these files?
It could be that you don't have your classpath set up correctly.
How are you compiling both of the files?
you should probably be in the same directory as the two files when you type javac, then you can type
javac -classpath ./ def.java
and the compiler will be able to find the referenced abc.java file.


Rob
SCJP 1.4
Dave Vick
Ranch Hand

Joined: May 10, 2001
Posts: 3244
okucuen
Welcome to the Java Ranch, we hope you’ll enjoy visiting as a regular however,
your name is not in keeping with our naming policy here at the ranch. Please change your display name to an appropriate name as shown in the policy.
Thanks again and we hope to see you around the ranch!!


Dave
Engin Okucu
Ranch Hand

Joined: Feb 09, 2002
Posts: 174
Rob , it's very nice from you?You're right. i had a problem whith my environnement variable. Classpath and path !!I changed it.
Dave , i thanks you so, As you can see , i have my name changed
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: can you help me please?: error whtih inheritance