One method in a class is called an instance method and the other is called a class method (static method). The following is a summary of who can access it: i. Class methods can call class methods by class name. class method, Object Name. class Method public class MethodDemo {public static void main (String [] args) {MethodDemo m = new MethodDemo (); m. f (2); MethodDemo. f (3);} public static int f (int x) {int y = 2 * x + 5; m. f (3); return y;} public int m (int x) {int z = 3 * x + 6; return z ;}} method of instance method invocation: object Name. class Method public class MethodDemo {public static void main (String [] args) {MethodDemo m = new MethodDemo (); m. m (3);} public static int f (int x) {int y = 2 * x + 5; return y;} public int m (int x) {int z = 3 * x + 6; return z ;}} 3. instance methods cannot be called in class methods, however, the instance method can call the class method public static int g (int x) {int z = 3 * x + 6; // m (3); return z ;} public int m (int x) {int z = 3 * x + 6; g (3); return z;} can be called in particular: you can call the instance method in the class method, or call the class method public class MethodDemo {public static void main (String [] args) {MethodDemo m = new MethodDemo (); m. m (3);} public static int g (int x) {int z = 3 * x + 6; // class method call the instance method MethodDemo m = new MethodDemo (); m. m (3); return z;} public int m (int x) {int z = 3 * x + 6; // call the class method MethodDemo In the instance method. f (3); f (4); return z ;}} 4. static methods can access variable types static instance methods. Both types of variables can be public class MethodDemo {int shili; static int jintai; public static int g (int x) {int z = 3 * x + 6; // System. out. println (shili); System. out. println (jintai); return z;} public int m (int x) {int z = 3 * x + 6; System. out. println (shili); System. out. println (jintai); return z ;}}