Sponsored Link •
|
Advertisement
|
Advertisement
|
This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.
Message:
> 1) What classpath i should set? > both. set your classpath to pkg1 AND pkg2 > > for SUPERCLASS: > public class SUPERCLASS { > for SUBCLASS: > import pkg1; > public class SUBCLASS extends SUPERCLASS { > *or* > public class SUBCLASS extends pkg1.SUPERCLASS { > > ???
My Directory structure is as follows
i added the following in the classpath d:\root\pack1;d:\root\pack2 i compiled superclass in pack1 (package 1 direcotory) w/o errors But when i compile subclass or (derived class) i derived.java:3: Package pack1 not found in import.
Source code for both the files r as follows : SUPERCLASS public class superclass public void display() Source code for DERIVED class is as follows package pack2; import pack1.*; class derived extends root.superclass public derived(){} public static void main(String args[]) ClassPath which i have set is as follows .;C:\jdk1.2.2\bin;C:\jdk1.2.2\lib;D:\Blazix\blazix.jar;.;C:\jsdk1.1\lib;c:\jsdk1.1\src;d:\.;d:\root\pack1;d:\root\pack2
Replies:
|
Sponsored Links
|