public class MainActivity { //... }
public void getUserInfo() { //... }
public String userName = "Tom";
if (condition) { //... }
int a = 1 + 2; if (condition && condition2) { //... }
// This is a long comment that should be aligned with the code below: int a = 1 + 2 + 3 + 4;
public class MyClass {
private int field1;
private int field2;
public MyClass(int field1, int field2) {
this.field1 = field1;
this.field2 = field2;
}
public int getField1() {
return field1;
}
public int getField2() {
return field2;
}
}
// This method returns true if the user is logged in. public boolean isLoggedIn() { //... }
// This is a long comment that should be aligned with the code below: int a = 1 + 2 + 3 + 4;
注:本示例代码仅作为规范参考,具体情