1 Example
public static Boolean valueOf(boolean b) {
return b ? Boolean.TRUE : Boolean.FALSE;
}
2 ?
Fragment fragment = new MyFragment();
// or
Date date = new Date();
Fragment fragment = MyFragment.newIntance();
// or
Calendar calendar = Calendar.getInstance();
// or
Integer number = Integer.valueOf("3");
3 Advantage
3.1 比构造器多名字
valueOf
、newInstance
、getInstance