This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Integration with C


gbevin at uwyn dot com writes:
 > Hmm just thought of something else. What you suggest is a function, not 
 > a class method. So it only calls the class with a static method, it 
 > doesn't access a method of a class instance. Is it possible to add a 
 > method like this to the class's api, or do I have to provide the class 
 > instance to a similar function if I don't want to work with static 
 > methods for this?

It's not possible to define a Java method that isn't declared in the
corresponding java .class file.  As a consequence of that, every
argument to that method must be well-defined from a Java point of
view.  So, you can't have a native method that takes a void*, for
example.  However, you can define a C++ wrapper class with a data
member which refers to the Java class.

Andrew.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]