Label

Thứ Tư, 30 tháng 5, 2012

Field Naming Conventions for Android


  • Non-public, non-static field names start with m.
  • Static field names start with s.
  • Other fields start with a lower case letter.
  • Public static final fields (constants) are ALL_CAPS_WITH_UNDERSCORES.

For example:
public class MyClass {
    public static final int SOME_CONSTANT = 42;
    public int publicField;
    private static MyClass sSingleton;
    int mPackagePrivate;
    private int mPrivate;
    protected int mProtected;
}

http://source.android.com/source/code-style.html

Thứ Hai, 28 tháng 5, 2012

Package java.qmn.thread can't find main class ???

Đặt package name là java.qmn.thread -> compile báo là không tìm thấy main class
Đổi thành notjava.qmn.thread thì compile được, nghĩa là compiler package mình ngang thư mục với package java có sẵn, học thêm một cái mới.