您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

MethodRedirectToStatic.java 445B

12345678910111213141516171819202122
  1. package test3;
  2. public class MethodRedirectToStatic {
  3. public static void main(String[] args) {
  4. System.out.println(new MethodRedirectToStatic().test());
  5. }
  6. int add(int a, int b) {
  7. return a + b;
  8. }
  9. public int test() {
  10. return add(1, 2);
  11. }
  12. }
  13. class MethodRedirectToStatic2 {
  14. public static int add2(MethodRedirectToStatic target, int a, int b) {
  15. return target.add(a * 10, b * 10);
  16. }
  17. }