大神看一眼错哪里了
public class Yuman{public static void mian(String[] args){
int x=5,y=10;
if (x<y);
{
System.out.println("正确");
}
else;
{
Sytem.out.println("错误");
}
}
}
2018-10-17 17:38
2018-10-17 17:38
2018-10-17 17:57
2018-10-17 21:49
程序代码:package com.huawei.test22;
public class Test {
public static void main(String[] args) {
int x = 5, y = 10;
System.out.println(x < y ? "正确" : "错误");
}
}
2018-10-17 22:10
程序代码:
public class Yuman{
public static void mian(String[] args){ //这里方法名错误
int x=5,y=10;
if (x<y); //这里不应该有分号
{
System.out.println("正确");
}
else; //这里不应该有分号
{
Sytem.out.println("错误"); //这里应该为System,你少了一个s
}
}
}
程序代码:
public class Yuman{
public static void main(String[] args){
int x=5,y=10;
if (x<y) //你这里原来有分号,现在取消
{
System.out.println("正确");
}else{ //你这里原来有分号,现在取消
System.out.println("错误"); //这里给你添加了一个s,使Sytem成为正确的System
}
}
}
2018-10-18 16:30