Help coderanch get a
new server
by contributing to the fundraiser
  • 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
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

Need Help with methods

 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Im getting an error when i call methods i created
in another java file. How do i get this file to
associate with the other java file that i created
my methods in? thanks for your help. Here is code

[ October 28, 2003: Message edited by: Jere Johnson ]
[ October 28, 2003: Message edited by: Jere Johnson ]
 
Ranch Hand
Posts: 1067
2
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What does "/*public" match up with?
Please post errors.
Normally if you have the other class in the same directory and compile all the files in that directory - java is able to find methods in other classes. (Assuming that the methods are "public" and stuff like that.)
 
Ranch Hand
Posts: 3244
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Jere
You don't have an object associated with the method being called so the ompiler is looking for the isCurrent method in the class it is called from. If the isCurrent method is defined in another class you need an instance of that class to call it on. Like this:
otherClassInstance.isCurrent()
hope that helps
reply
    Bookmark Topic Watch Topic
  • New Topic