Java变量及其运算

1、

long a=5423453432424L;
float f=(float) 12.5874;

2、
static String valueOf(boolean b)
Returns the string representation of the boolean argument.
static String valueOf(char c)
Returns the string representation of the char argument.
static String valueOf(char[] data)
Returns the string representation of the char array argument.
static String valueOf(char[] data, int offset, int count)
Returns the string representation of a specific subarray of the char array argument.
static String valueOf(double d)
Returns the string representation of the double argument.
static String valueOf(float f)
Returns the string representation of the float argument.
static String valueOf(int i)
Returns the string representation of the int argument.
static String valueOf(long l)
Returns the string representation of the long argument.
static String valueOf(Object obj)
Returns the string representation of the Object argument.

3、
static int parseInt(String s)
Parses the string argument as a signed decimal integer.
static double parseDouble(String s)
Returns a new double initialized to the value represented by the specified String, as performed by the valueOf method of class Double.

4、+号用于字符串,可以自动将非字符串转换成字符串

5、算术>关系>逻辑

你可能感兴趣的:(#,Java)