Get the latest tech news
A basic introduction to the classfile API in Java
A Basic Introduction to the Classfile API
With that change, we can run our program with: java --enable-preview --source 23 Runner.java and see a Person.class file generated in the current directory. Recall that Java requires the lovely public static void main (String[] args) to let the JVM know where to start executing code from. Using the class file API to generate JVM bytecode that creates a new object, and branches based on a random number
Or read this on Hacker News