神器Postfix

最近观看慕课网视频发现使用Postfix可以极大提高编码速度
常见的Postfix:

for

public class Foo {
    void m() {
        int[] values = {1, 2, 3};
        values.for
    }
}
public class Foo {
    void m() {
        int[] values = {1, 2, 3};
        for (int value : values) {

        }
    }
}

fori

public class Foo {
    void m() {
        int foo = 100;
        foo.fori
    }
}
public class Foo {
    void m() {
        int foo = 100;
        for (int i = 0; i < foo; i++) {

        }
    }
}

sout

public class Foo {
  void m(boolean b) {
    b.sout
  }
}
public class Foo {
  void m(boolean b) {
      System.out.println(b);
  }
}

field

public class Foo {
  public Foo(int arg) {
    arg.field
  }
}
public class Foo {
    private int foo;

    public Foo(int arg) {
        foo = arg;
    }
}

nn

public class Foo {
    void m(Object o) {
        o.nn
    }
}
public class Foo {
    void m(Object o) {
        if (o != null){

        }
    }
}

return

public class Foo {
    String m() {
        "result".return
    }
}
public class Foo {
    String m() {
        return "result";
    }
}

if

public class Foo {
    void m(boolean b) {
        b.if
    }
}
public class Foo {
    void m(boolean b) {
        if (b) {

        }
    }
}

更多Postfix可以查看idea,Find Action (Ctrl+Shift+A),查看Postfix

你可能感兴趣的:(神器Postfix)