JAVA中常用数据类型转换函数 string->byte
Byte static byte parseByte(String s)
byte->string
Byte static String toString(byte b)
char->string
Character static String to String (char c)
string->Short
Short static Short parseShort(String s)
Short->String
Short static String toString(Short s)
String->Integer
Integer static int parseInt(String s)
Integer->String
Integer static String tostring(int i)
String->Long
Long static long parseLong(String s)
Long->String
Long static String toString(Long i)
String->Float
Float static float parseFloat(String s)
Float->String
Float static String toString(float f)
String->Double
Double static double parseDouble(String s)
Double->String
Double static String toString(Double
Byte static byte parseByte(String s)
byte->string
Byte static String toString(byte b)
char->string
Character static String to String (char c)
string->Short
Short static Short parseShort(String s)
Short->String
Short static String toString(Short s)
String->Integer
Integer static int parseInt(String s)
Integer->String
Integer static String tostring(int i)
String->Long
Long static long parseLong(String s)
Long->String
Long static String toString(Long i)
String->Float
Float static float parseFloat(String s)
Float->String
Float static String toString(float f)
String->Double
Double static double parseDouble(String s)
Double->String
Double static String toString(Double
解决方案 »
- JAVA 构造对象的问题
- 在创建新的java project时候(文件中已有Welcome.java)会出现Welcome overlaps the location of anothe
- 基础问题--数值类型之间的合法转换
- Java Media Frame 在Applet中的应用
- 从MySQL v4.1.*中取出的中文是"???" 转码也没有啊
- 请问如何对filechooser中选择一个文件的事件进行设置处理
- 有JAVA基础,学习JSP要多久
- 帮忙翻译一下,谢了!
- 求教JBUILDER的使用问题!给分!
- LDAPException(resultCode=object class violation求大神解决
- 如何在swing中读入一张图片的部分
- 郁闷!在WinXP SP2装了 JRE 5.0 后,IE就说啥也起不来了,发生了“致命错误”……
Float f1=Float.valueOf(s);
float f2=Float.parseFloat(s);
Float f3=new Float(s);
呵呵……
如果在转变的时候类型不对,会报一个NunberFormatException
float f;
f=Float.parseFloat(str);
呵呵