• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Frank Carver
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • fred rosenberger

cannot resolve symbol error

 
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
drifter
Posts: 1364
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
I think she's lovely. It's this tiny ad that called her crazy:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic