// Collection of code snippets by Arne Vajhøj 
// (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
import java.lang.reflect.*;
import java.util.*;

public class ArrayOfMethodsReflection2 {
    public static void main(String[] args)throws Exception  {
        List<Method> lst = new ArrayList<Method>();
        for (Method met : ArrayOfMethodsReflection2.class.getMethods()) {
            lst.add(met);
        }
        lst.get(2).invoke(null, new Object[] { });
        lst.get(1).invoke(null, new Object[] { });
    }
    public static void a() {
        System.out.println("I am a");
    }
    public static void b() {
        System.out.println("I am b");
    }
}
