Discuss / Java / 交作业

交作业

Topic source

-不要回答

#1 Created at ... [Delete] [Delete and Lock User]
public class JoinChar {

	public static void main(String[] args) {
		// 请将下面一组int值视为字符的Unicode码,把它们拼成一个字符串:
		int a = 72;
		int b = 105;
		int c = 65281;
		String s ="" + a+b+c;
		System.out.println(s);
	}

}

有了第一个string,后面的 + 就是字符串的连接了操作符了,而不再是 char/int 的数值相加了。(楼上说的对)


  • 1

Reply