how to define a class as main java code example Example: main class java public static void main(String[] args) {}