In this example we will show you how to create a class method in Java.
Source Code
package com.beginner.examples;
public class CreateMethod {
static void test() { // create a class method
System.out.println("ok");
}
public static void main(String[] args) {
test();
}
}
Output:
ok