This article is based on the art of writing readable code. It is very well written!
Sometimes, we can use column alignment to make the code easier to read. The instance code is as follows:
Package COM. jue. test; public class student {// a meaningful sorting order in which public final static int index_id = 0; public final static int index_name = 1; public final static int index_phonenumber = 2; public final static int index_address = 3; // a meaningful sorting order of int ID; string name; string phonenumber; string address; Public student () {} public student (int id, string name, string phonenumber, string address) {// a meaningful sorting order this. id = ID; this. name = Name; this. phonenumber = phonenumber; this. address = address;} public student (Student) {// a meaningful arrangement order this. id = student. ID; this. name = student. name; this. phonenumber = student. phonenumber; this. address = student. address;} private int copyfromcursor (cursor c) {// a meaningful sorting order this. id = C. getcolumnindexorthrow (index_id); this. name = C. getcolumnindexorthrow (index_name); this. phonenumber = C. getcolumnindexorthrow (index_phonenumber); this. address = C. getcolumnindexorthrow (index_address);} public static void main (string ARGs []) {student Xiaoming = new student (0, "Zhang Xiaoming", "15010112299", "Xinjiang Uygur Autonomous Region "); student Wanggang = new student (1, "Wang Gang", "13900000099", "Beijing"); Student liyue = new student (2, "Li Yue", "18510112299 ", "Tibet Tibetan Autonomous Region"); Student WangLi = new student (3, "Wang Li", "13588112299", "Yunnan Province ");}}