example of class method and instance method in java

Class Method are those methods in which we must create the Object of the class
While in instance method we does not required to create the object of the class
we can call instance method using class name

public class ClassInstanceMethod {
public static void main(String[] args) {
ClassMethodExample Obj = new ClassMethodExample();


class InstanceMethodExample {
public static void InstanceMethod() {
System.out.println(“I am a Instance method”);

class ClassMethodExample {
public void ClassMethod() {
System.out.println(“I am a class method”);