I am a fan of static metaprogramming in C++. I know Java now has generics. Does this mean that static metaprogramming (i.e., compile-time program execution) is possible in
What do you exactly mean by "static metaprogramming"? Yes, C++ template metaprogramming is impossible in Java, but it offers other methods, much more powerful than those from C++:
There's no best method: each of those methods has its strengths and weaknesses. Due to flexibility of JVM, all of those methods in Java can be used both at compilation time and runtime.