How to change the Java default curly braces alignment and java parentheses alignment
(1) Many programmers feel that this is not so neat when using the brackets alignment of Java!
Many people are wondering why:
public class HelloWorld{ pulic static void main(String[] args){ System.out.println("Hello World"); }}
Rather than this (I personally feel this alignment is more comfortable! Look great !)
public class HelloWorld{ pulic static void main(String[] args) { System.out.println("Hello World"); }}
(2) OK! The solution is coming! Please look down!
Step 1: window -----> preferences ------> Java -------> Code Style -------> Formatter.
Step 2: Click Edit -------> Braces
You can see the Same Line or something !!! Oh, you understand !!
Step 3: Click the Same Line drop-down box and you will see Next Line. Then you can see the effect on the right!
Step 4: enter the name of this format in Profile name! Click OK
Step 5: select the format you just named in Active profile (here I am using MyselfEclipse [built-in])
In the above drop-down box, you can also select the default format Eclipse [Bucket-in] OK!
With obsessive-compulsive disorder, you can finally rest assured! I am in a good mood. Abuse me as much as possible!
How to achieve automatic alignment with curly brackets when developing Android using eclipse? It turns out that eclipse is alignment in java but still not alignment in Android
Press ctrl + shift + f to format the code
How to set the alignment of Dev C ++ curly brackets?
There is no place to set it. In fact, it is more convenient to use other text editing tools, such as ultraedit. When your text is in the C/C ++ syntax, it can make brackets automatically alignment on the same column, which is very convenient to use. It is much better than the editor with dev c ++.