Java: Is there support for macros?

后端 未结 7 1195
暗喜
暗喜 2021-02-12 17:47

I am just curious on how people solve this. I often write the same type of code all the time. For instance:

new Thread() {
   //...
   //...
   //...
   //Change         


        
7条回答
  •  谎友^
    谎友^ (楼主)
    2021-02-12 18:46

    It's possible to use Java annotations to generate boilerplate code. Writing your own annotation processor is not hard.

提交回复
热议问题