String str1 = 4; //判断对错:no
String str2 = 3.5f + “”; //判断str2对错:yes
System.out.println(str2); //输出:3.5
System.out .println(3+4+“Hello!”); //输出:7Hello!
System.out.println(“Hello!”+3+4); //输出:Hello!34
System.out.println(‘a’+1+“Hello!”); //输出:98Hello!
System.out.println(“Hello”+‘a’+1); //输出:Helloa1
1)short s = 5;
s = s-2;
2) byte b = 3;
b = b + 4;
b = (byte)(b+4);
3)char c = ‘a’;
int i = 5;
float d = .314F;
double result = c+i+d;
4) byte b = 5;
short s = 3;
short t = s + b;
public class Short01 {
public static void main(String[] args) {
short s = 5;
// s=s-2;
s = (short) (s - 2);
byte b = 4;
// b=b+4;
b = (byte) (b + 4);
char c = 'a';
int i = 5;
float d = .314F;
double result = c + i + d;
byte m = 5;
short n = 3;
short t = (short) (m + n);
}
}