Usually, with modern tools such functions are not longer necessary and with a good design and some abstraction and the interfaces that Java provides it is in general not necessary to have macros in Java . Java is designed, afaik, to make it as hard as possible to shoot yourself.