JAVA新手遇到能在CMD里面编译出来,但是运行不了。在Eclipse里面点击运行显示ANT构建
代码如下:importjava.util.Scanner;classfuction{publicintTestFeb(intyear){//intyear=1900;if...
代码如下:
import java.util.Scanner;
class fuction{
public int TestFeb(int year){
//int year = 1900;
if(((year%4==0)&&(year%100!=0))||(year%400==0))
return 29;
else
return 28;
}
public fuction(){
}
}
public class application{
public static void main(String[] args){
Scanner input = new Scanner(System.in);
int year = input.nextInt();
fuction ApplicatFuction = new fuction();
System.out.println(ApplicatFuction.TestFeb(year));
}
}
请求解,问题出现在哪里? 展开
import java.util.Scanner;
class fuction{
public int TestFeb(int year){
//int year = 1900;
if(((year%4==0)&&(year%100!=0))||(year%400==0))
return 29;
else
return 28;
}
public fuction(){
}
}
public class application{
public static void main(String[] args){
Scanner input = new Scanner(System.in);
int year = input.nextInt();
fuction ApplicatFuction = new fuction();
System.out.println(ApplicatFuction.TestFeb(year));
}
}
请求解,问题出现在哪里? 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询