请写出下列程序的输出结果一public class Test52 { String str1=”Hello,Java w

请写出下列程序的输出结果

public class Test52
{
String str1=”Hello,Java world!t”;
String str2=”Hello,students!” ;
public static void main(String args[])
{
System.out.print(str1);
System.out.println(str2);
}
}

public class T2_4 {
public static void main(String[] args)
{
int i,j;
char c='*';
for(i=0;iw;
System.out.println("z>w=="+flag);
}
}
zxocvyasoidfyoai 1年前 已收到1个回答 举报

linkyxiaoyao 幼苗

共回答了17个问题采纳率:94.1% 举报

1
编译错误,main方法不能调用非static的变量
如果这样修改下
public class Test52 {
static String str1 = "Hello, Java world! t";
static String str2 = "Hello, students!";

public static void main(String args[]) {
System.out.print(str1);
System.out.println(str2);
}
}
结果是
Hello, Java world! Hello, students!
2
*
* *
* * *
* * * *
* * * * *
3
x>y==false
z>w==true

1年前

8
可能相似的问题
Copyright © 2024 YULUCN.COM - 雨露学习互助 - 16 q. 0.022 s. - webmaster@yulucn.com