Java Reflection 5 Class Metot’u Cagirmak(invoke)
public class Person { public int alfa(String a) { return a.length(); } public static String beta(int a) { return “a+5=”+(a+5); } } Person person = new Person(); try { // instance method call Method method = person.getClass().getMethod(“alfa”,String.class); int a = (int) method.invoke(person, “dogukan”); System.out.println(a); // static method call method = person.getClass().getMethod(“beta”,int.class); String out = (String) …
Java Reflection 5 Class Metot’u Cagirmak(invoke) Read More »