indira
indira

Reputation: 6687

How to get the signature of a method which is inside a Interface?

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.

Upvotes: 0

Views: 288

Answers (2)

phlogratos
phlogratos

Reputation: 13924

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

Upvotes: 0

bluefalcon
bluefalcon

Reputation: 4245

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.

Upvotes: 1

Related Questions