mardi 3 mars 2015

Use static class Method in interface type class in Java



How to use public static class method in Interface class?


for example:



public class Var {
private static String api_key;

public static String getApi_key() {
return "Authorization: " + Var.api_key;
}

public static void setApi_key(String api_key) {
Var.api_key = api_key;
}
}


then i want to get method getApi_Key(); //return String 2773167988874443412478834 to be usable in interface class



public interface VerifyClient {
String api = Var.getApi_Key();

VerifyResponse verify(api);
}


iv'e tried many approach but it wont work. so how to solve this?




Aucun commentaire:

Enregistrer un commentaire