Java Development IDE, development tool: intellij idea 10.5.2, jetbrains latest version, official website:
Http://www.jetbrains.com/, the best Java development tool, very intelligent, writeCodeExtremely fast and highly recommended.
Easy to use, large shortcut key settings, you only need to press the shortcut key to automatically generate a large segment of code, and even the entire file.
For example, most of the time, we need to generate such a piece of code:
Public static void main (string [] ARGs ){
Systemmanagerdao SMD = new systemmanagerdao ();
}
You only need to press Ctrl + J at the position you want to insert. Many shortcut keys are displayed, and there is a complete introduction on the right side. Then press p, in this case, a combination of four Shortcut Keys starting with "P" is displayed. If you select "psvm", it is a combination of each start Letter of the Four keywords of "public static void main. Press enter to generate the main method. The rest are the same. Press Ctrl + J at the same time and then select the shortcut key combination you want. For example, select psfi and press Enter. Will automatically public static final int code. There are many combinations under the CTRL + J key, and a for loop can be generated.
1. The following describes several commonly used combinations of Ctrl + J keys (the shortcut keys are all in lower case ):
Psfs: public static final string
Psfi: public static final int
Psvm: public static void main (string [] ARGs ){
}
PSF: public static final
Serr: system. Err. println ("");
Souf: system. Out. printf ("");
Sout: system. Out. println ("");
Soutm: system. Out. println ("systemmanagerdao .");
Soutv: system. Out. println ("Var =" + var );
Arraylist <sysuservo> arraylist = new arraylist <sysuservo> ();
ITER: For (sysuservo: arraylist)
The above code is the most commonly used. If there are more, we will not list them one by one.
2. Next we will introduce another more intelligent shortcut key combination, ALT + enter.
A. if we want to call the leftadd () method somewhere, but do not define this method, if we write string STR = leftadd (, "0 "); the red line is straight. We can move the mouse to the red wavy line, press Alt + enter, select as prompted, and press Enter. Code segment 1 will be automatically generated (of course, the method body still needs to be written by yourself. The knowledge generates an empty method body)
B. generally, when an error occurs in our code, intellij idea automatically adds a red Ripple under the wrong code, then, we just need to move the mouse to the Tilde line to see the error message, and press Alt + enter. Depending on the error, different operation options are displayed, select the item you want to modify and press Enter. It automatically detects the code in real time and tells you the specific cause of the error, which is very convenient.
For warning code, intellij idea will display the warning code in a gray background at a glance, and place the cursor over the code, there will be a prompt, press Alt + enter and follow the prompts to complete code optimization.
When we write code, sometimes we write part of the code first. For example, when we write a try-Catch Block, we may write it first.
Try {
}
Then write other code in it. If an exception occurs in the code in the result, a red line will appear below, move the mouse to the wavy line, and press Alt + enter. A prompt will be displayed, after selecting the carriage return, the catch () {} code is generated, and you do not need to press it manually.
Remember, in most cases, when we see a red line below the code, we move the mouse to the place where the line is wavy, look at the prompts, and press Alt + enter to follow the prompts.
The ALT + enter key is a commonly used shortcut key.
3. Among the three most commonly used shortcut keys (CTRL + J, ALT + enter, Shift + space), there is also a combination of Shift + space keys.
This shortcut key must be set first. If it is not set, it is a combination of Ctrl + space by default, but it will conflict with our Chinese and English switch keys. Therefore, we recommend that you set it to shift + space.
The settings are as follows: Open intellij idea and find the icon with a wrench in the toolbar. This is a setting tool, including a rich set operation. Click to bring up the setting form, find "keymap" under the left column, double-click, find the "Main Menu" item on the right, expand, find "code", expand, find "complete code" and select "Basic". A shortcut key combination is displayed on the right, that is, CTRL + space. Select and remove it, and click Add, then, press SHIFT + space in the top text box and click "OK.
Press SHIFT + space to bring up the class name, method name, and so on. It is very useful.
4. the CTRL + ALT + L combination will format the entire file code, so that our code will not look messy and neat.
5. there are many shortcut keys, which are very convenient. It is very convenient to add jar packages and javadoc, after adding javadoc, you only need to press Ctrl + Q on the class name or method to display the detailed introduction of the class or method, which is very easy to use.
All shortcut key functions are described in the Help directory of the intellij idea installation directory. There are two PDF files under the help directory. open the file and you will see the usage of all shortcut keys.
Intellij idea is indeed a Java DevelopmentProgramVery good software, easy to use, fast coding, and greatly reduced code error rate. I think every Java programmer will love it. We recommend it to you.
The functions of intellij idea are much more than described above. It is just the most basic, and it is much easier to use than other ide such as myeclipse and JBuilder.
The following shows the entire project directory structure, which is very clear.
/**
* Add the specified character before the counter and format the counter. <br>
* For example: Count: 1-1000, digit is at least 4, and output is the same if it is greater than the maximum value of the given digit-1 <br>
*
* @ Param count counter
* @ Param digit digits
* @ Param Rex prefix character
* @ Return format the counter string with the given number of digits
*/
Code snippet 1:
Public static string leftadd (INT count, int digit, string Rex ){
Int maxnumber = 0;
String STR = "";
For (INT I = digit-2; I> = 0; I --){
Maxnumber + = 9 * Math. Pow (10, I );
}
If (count <= maxnumber ){
Int G = digit-(string. valueof (count). Trim (). Length ();
For (Int J = 1; j <= g; j ++ ){
STR + = Rex;
}
Return (STR + count). Trim ();
} Else {
Return string. valueof (count). Trim ();
}
}