parse public abstract Date parse(String source, ParsePosition pos)Parse a date/time string according to the given parse position. For example, a time text "07/10/96 4:5 PM, PDT" will be parsed into a Date that is equivalent to Date(837039928046). By default, parsing is lenient: If the input is not in the form used by this object's format method but can still be parsed as a date, then the parse succeeds. Clients may insist on strict adherence to the format by calling setLenient(false). Parameters:source - The date/time string to be parsedpos - On input, the position at which to start parsing; on output, the position at which parsing terminated, or the start position if the parse failed. Returns:A Date, or null if the input could not be parsedSee Also:setLenient(boolean)intValue public int intValue() Returns the value of this Float as an int (by casting to type int). Specified by: intValue in class Number Returns: the float value represented by this object converted to type intfloatValue public float floatValue() Returns the float value of this Float object. Specified by: floatValue in class Number Returns: the float value represented by this object
String.valueOf(float i);
int i
i.toString()
float f
f.toString()
String:
->int: Integer.parseInt(str)
->float: Float.parseFloat(str)
->double: Double.parseDouble(str)||Double.valueOf(str)
->boolean: Boolean.valueOf(str).booleanValue()
->bytes: str.getBytes()
->Date:int:
->String: String.valueOf(intvalue)||intvalue.toString()
->int:
->float:
...float:
->String: String.valueOf(floatvalue)||floatvalue.toString()
->int:
->float:
boolean:
->String:bytes:
->String:Date:
->String:
等
大家把自己知道的都填出来
public abstract Date parse(String source,
ParsePosition pos)Parse a date/time string according to the given parse position. For
example, a time text "07/10/96 4:5 PM, PDT" will be parsed into a Date
that is equivalent to Date(837039928046). By default, parsing is lenient: If the input is not in the form used
by this object's format method but can still be parsed as a date, then
the parse succeeds. Clients may insist on strict adherence to the
format by calling setLenient(false).
Parameters:source - The date/time string to be parsedpos - On input, the position at which to start parsing; on
output, the position at which parsing terminated, or the
start position if the parse failed.
Returns:A Date, or null if the input could not be parsedSee Also:setLenient(boolean)intValue
public int intValue()
Returns the value of this Float as an int (by casting to type int). Specified by:
intValue in class Number
Returns:
the float value represented by this object converted to type intfloatValue
public float floatValue()
Returns the float value of this Float object. Specified by:
floatValue in class Number
Returns:
the float value represented by this object
string - >BigDecimal 怎么办?
i am a newman
原生值==>包装类 (new 包装类(原生值))
包装类==>原装值 (包装类.xxxValue())
原生类==>String (String.ValueOf(原生值))
String==>原生类 (包装类parseXXX 、getBoolean等)
对象 ==>String (object.toString())
日期 <==>String (java.util.DateFormat.format 或 parse)