0

I have a class named Fruits. Inside the class there is a interface named Sour. Inside the Interface I have a method GetItems();

public class Fruits
{
    ----------------
    ----------------
    public interface Sour
    {
        public int GetItems();
    }
}

How to get the signature of the GetItems() method?. I want to use this signature in JNI GetMethodID method.

indira
  • 6,569
  • 18
  • 65
  • 80
  • Where are you trying to get this from? In Java code you can use reflection to get `Method` object representing your method - and then use it to reconstruct the signature. – Aleks G Jul 20 '11 at 11:26

2 Answers2

1

Some class has to first implement that interface.

Once a class has imlpemented an interface then you should be able to get the methodID for the interface method, which is now a member of the class that implemented it.

bluefalcon
  • 4,225
  • 1
  • 32
  • 41
0

You can't use JNI without a class implementing your Interface. Just use the signature of this implementing class.

phlogratos
  • 13,234
  • 1
  • 32
  • 37