老师请检查
来源:3-19 编程练习
piii
2020-03-31 17:49:27
public class StringDemo1 {
public static void main(String[] args) {
// 定义一个布尔类型的变量flag,赋值为true,并输出
boolean flag=true;
System.out.println("flag="+flag);
//定义一个字符串类型的变量str,值为"hello world",并输出
String str="hello world";
System.out.println("str="+str);
//定义一个字符串类型的变量str1,值为空串
String str1="";
//将str的值赋值给str1,并输出
str1=str;
System.out.print("str="+str);
}
}
1回答
同学你好,程序正确,写的很棒,继续加油。
如果我的回答解决了你的疑惑,请采纳。祝:学习愉快~