Note: Since I have only written a blog for a while, the summary is not perfect at present, and will be gradually improved in the future. For details, please refer to the free course of MOOC: IntelliJ IDEA artifact usage skills: http://www.imooc.com/learn/924 (Thanks to the author of the course: The Flash)
Shortcut key to
create file:
ctrl+alt+insert: Create Class files, folders...
Smart return:
Ctrl+alt+V: Smart return response type result
row operation:
1. shift+Enter: insert a row down
2. ctrl+alt+Enter: insert a
row
operation 1. alt+left mouse button: column edit
2 . ctrl+alt+shift+J: select all selected symbols (eg: select all semicolons)
3. ctrl+right arrow: move the cursor to the next word
4. ctrl+shift+right arrow: move the cursor down A word and select
5. shift+Home: move the cursor to the beginning of the line and select
6. shift+End: move the cursor to the end of the line and select
7. F2/shift+F2: quickly navigate down (up) to the wrong line
8. alt+insert: generate constructor, get/set method, override method, toString()...
9. alt+enter: intelligent prompt
Postfix: Postfix, Postfix(for, sout, field(name.field)... There are many defaults to be studied later)
1. 100.for
2. date.sout
3. "String".r + up arrow
4 .name.nn (non-null judgment), name.null (null judgment)
1 import java.util.Date; 2 3 /** 4 Postfix: suffix, Postfix(for, sout, field(name.field)... There are many defaults, which will be studied later) 5 1. 100.for 6 2. date.sout 7 3. "String".r + up arrow 8 9 4. name.nn, name.null 10 11 */ 12 public class Postfix { 13 14 public static void main(String[] args) throws InterruptedException { 15 for ( int i = 0; i < 100; i++ ) { 16 Date date = new Date(); 17 Thread.sleep(1000); 18 System.out.println(date); 19 } 20 } 21 private String name = "zs"; 22 private int age = 20; 23 24 private String getStr(){ 25 if (name != null) { 26 27 } 28 if (name == null) { 29 30 } 31 return "string"; 32 } 33 34 }
alt+enter: Smart Tips
import java.util.List;
/**
AltEnter: Smart prompt
Note: ctrl+alt+insert: Create Class files, folders...
1. Automatically create functions
2. List replace
3. String format or build
4. Word Spelling
5. Import package
*/
public class AltEnter {
/**
* 1. Automatically create function
* 2. List replace
* @param args
*/
public static void main(String[] args) {
fuc1();
fun3() ;
}
private static String fuc1() {
return "string";
}
/**
* 2. List replace
* @param list
*/
private static void fun2(List<String> list) {
int i = 0;
while (true) {
if (!(i < list.size())) break;
i++;
}
}
/**
* 3. 字符串的format或者build
*/
private static void fun3() {
String name = "zs";
int age = 20;
String x1 = String.format("name: %s, age: %d", name, age);
String x2 = new StringBuilder().append("name: ").append(name).append(", age: ").append(age).toString();
System.out.println(x1);
System.out.println("---------------");
System.out.println(x2);
}
}