| Author |
cannot resolve symbol error
|
Nee Kat
Ranch Hand
Joined: Jan 27, 2004
Posts: 37
|
|
I have two classes and trying to call a method from one class to another but getting this error. Here is the class having the method: import java.util.*; import java.io.*; public class MethodContainer{ public void printer(int ho) { System.out.println( "This works"+ho); } } and here is the main class import java.util.*; import java.io.*; public class callMethod{ public static void main( String args[]) { int ho = 100; MethodContainer methodReceiver = new MethodContainer(); methodReceiver.printer(ho); } } I am getting these errors: cannot resolve symbol symbol : class MethodContainer location: class callMethod MethodContainer methodReceiver = new MethodContainer(); cannot resolve symbol symbol : class MethodContainer location: class callMethod MethodContainer methodReceiver = new MethodContainer(); Help needed. Thanks.
|
 |
Carol Enderlin
drifter
Ranch Hand
Joined: Oct 10, 2000
Posts: 1348
|
|
You may need to set your classpath to include the directory with your code in it. See setting the classpath FAQ. I'm on windows and using jdk 1.4 and simply set classpath to current directory. set classpath=. If that doesn't fix things, then let us know what jdk you're using, what file names you are saving those two classes with and the command you're running, what directory you're working in.
|
 |
 |
|
|
subject: cannot resolve symbol error
|
|
|