/*** @author LiuYan* @date 2021年11月11日 17:32*/public class Part01 {public static void main(String[] args) {// 创建字符串String str = "hello";String helloStr = new String("hello");// 字符数组构建字符串char[] chars = {'a', 'b', 'c'};String str1 = new String(chars);// 字节数组构建字符串byte[] bytes = {100, 99, 98};String str2 = new String(bytes);// 将截取的字符数组转换为字符串String str3=new String(bytes,0,2);System.out.println(str3);// char 可以和整数类型相互转换byte b = 10;short s = 10;int i = 10;long l = 10;char c;c = (char) b;c = (char) s;c = (char) i;c = (char) l;l=c;}}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。