I have two class file in my curent directory. Public class A and public class B.
I am working in curent directory and both classes are in the same directory. I want to create an object of class A in class B.
But whenever i try to compile my B class it gives an erroe message cannot resole sybole A.
I am using jdk1.3. The same problem i am facing with Interface also if i create a n interface amnd try to implement it in any other class in the same directory. The copmile time error shows symobole can't resolve.
I have been using Jdk1.2 and i have never faced such problem.
Please help me how to get rid of thois Problem.
Thanking You
Niraj
Discussions
Web tier: servlets, JSP, Web frameworks: Creating Instance of a public class from the currenyt directory
-
Creating Instance of a public class from the currenyt directory (5 messages)
- Posted by: Niraj Kumar Manglam
- Posted on: March 08 2001 13:06 EST
Threaded Messages (5)
- Creating Instance of a public class from the currenyt directory by Dima Ulberg on March 08 2001 17:14 EST
- Creating Instance of a public class from the currenyt directory by Niraj Kumar Manglam on March 09 2001 04:59 EST
- Creating Instance of a public class from the currenyt directory by Srinivas Janakiraman on March 09 2001 05:20 EST
- Creating Instance of a public class from the currenyt directory by Niraj Kumar Manglam on March 09 2001 04:59 EST
- Creating Instance of a public class from the currenyt directory by M Farhan on March 09 2001 00:46 EST
- Creating Instance of a public class from the currenyt directory by Niraj Kumar Manglam on March 13 2001 07:19 EST
-
Creating Instance of a public class from the currenyt directory[ Go to top ]
- Posted by: Dima Ulberg
- Posted on: March 08 2001 17:14 EST
- in response to Niraj Kumar Manglam
Compile both in one command:
javac -d . A.java B.java
-
Creating Instance of a public class from the currenyt directory[ Go to top ]
- Posted by: Niraj Kumar Manglam
- Posted on: March 09 2001 04:59 EST
- in response to Dima Ulberg
I am still not able to create an object of another public class in the same directory. I am using Win 2000 and jdk1.3.
Please help me.
Thanx
Niraj -
Creating Instance of a public class from the currenyt directory[ Go to top ]
- Posted by: Srinivas Janakiraman
- Posted on: March 09 2001 17:20 EST
- in response to Niraj Kumar Manglam
Execute the dos command echo %classpath% and get all the directories listed in classpath and examine all the classpath for public class A. There must be more than one. So jvm unable to decide which class A to take.
Srinivas.J -
Creating Instance of a public class from the currenyt directory[ Go to top ]
- Posted by: M Farhan
- Posted on: March 09 2001 00:46 EST
- in response to Niraj Kumar Manglam
Try setting the classpath, give the classpath as your current directory. -
Creating Instance of a public class from the currenyt directory[ Go to top ]
- Posted by: Niraj Kumar Manglam
- Posted on: March 13 2001 07:19 EST
- in response to M Farhan
Thanx
i could make it anyhow.
Actually u have to compile both class at a time then only u will be able to create an instance of another class.
Thank you very much for ur cooperation
Niraj