This is not possible in java. You cannot call an method without an object.
What happens is basically this:-
public class MyClass {
public void method1() {
System.out.println("This is method1");
}
public void method2(int num) {
System.out.println("This will print the value of num " + num);
}
public static void main(String[] args) {
MyClass object1 = new MyClass();
object1.method1();
object1.method2(200);
}
}
This way you can access the methods.