Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

calling method from another package

 
dale con
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello

I have a package com.mypackage which has some methods

I have another package com.anotherapckage and i want to use a mehod in com.mypackage. How do i do this?

I've imported the package import com.mypackage then MyClass myclass = new MyClass();, but non of the methods are exposed

Many thanks
 
Layne Lund
Ranch Hand
Posts: 3061
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need some more information in order to help you. What compiler errors do you get? Also, please post the code for MyClass and the class that is trying to use methods from it.

Layne
 
dale con
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's OK sorted it. Needed to make the method static

Cheers
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic