0

I need to generate something like this with jcodemodel

package com.example;

    public class Main {

    static int a;

    static {
        a = 5;
    }

    public static void main (String[] args) {

    }

}

Google did not help. There is a class JBlock but there is nothing about initialization blocks.

user1745356
  • 4,462
  • 7
  • 42
  • 70

1 Answers1

3

need to call JDefinedClass.init() which returns JBlock

user1745356
  • 4,462
  • 7
  • 42
  • 70