The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
October 2001

Advertisement

Advertisement

This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.

Message:

invoke method from outside package

Posted by nada on November 12, 2001 at 3:59 PM

Hello every body ,
i have the follwoing code :

file a.java conatin :

class a {
.......
public void invokeUserMethod(){
System.out.println("i'm here ") ;
m.invoke(......) ;
.................
}
}// a
file b.java conatin :
class b {
void m() {
................ ; invokeUserMethod() ;.............
}
}//class b

the previous will work correctly .However , when i put class a in package then i import it in class b and from class b i call method invokeUserMethod then the problem araise and the result be at run time :

i'm here
NullPoinetr....

is this mean that invoke method can't call method from outside package and is there is any solution for this problem .
please i need any body to tell me where is the problem
and what is the solution

Thanks a lot
Nada




Replies:

Sponsored Links



Google
  Web Artima.com   
Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us