博客
关于我
【计算机二级Java语言】卷013
阅读量:466 次
发布时间:2019-03-06

本文共 521 字,大约阅读时间需要 1 分钟。

为了使Java_1.java程序能够判断输入的年份是否为闰年,我们需要在注释行"//Found"下一行语句的下划线处填入正确的代码。正确的代码如下:

public void ________(Graphics g) {    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));    System.out.println("请输入年份:");    String input = br.readLine();    int year = Integer.parseInt(input);    if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)) {        System.out.println("是闰年!");    } else {        System.out.println("不是闰年!");    }}

注:请将上述代码插入到下划线处,并删除下划线本身。请勿删除注释行或改动其他已有语句内容。存盘时文件必须存放在考生文件夹下,不得改变原有文件的文件名。

转载地址:http://pthyz.baihongyu.com/

你可能感兴趣的文章
Oracle:ORA-00911: 无效字符
查看>>
Text-to-Image with Diffusion models的巅峰之作:深入解读 DALL·E 2
查看>>
TCP基本入门-简单认识一下什么是TCP
查看>>
tableviewcell 中使用autolayout自适应高度
查看>>
Orcale表被锁
查看>>
svn访问报错500
查看>>
org.apache.ibatis.exceptions.TooManyResultsException: Expected one result (or null) to be returned
查看>>
org.apache.ibatis.type.TypeException: Could not resolve type alias 'xxxx'异常
查看>>
org.apache.poi.hssf.util.Region
查看>>
org.apache.xmlbeans.XmlOptions.setEntityExpansionLimit(I)Lorg/apache/xmlbeans/XmlOptions;
查看>>
org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperErrorCode = ConnectionLoss for /
查看>>
org.hibernate.HibernateException: Unable to get the default Bean Validation factory
查看>>
org.hibernate.ObjectNotFoundException: No row with the given identifier exists:
查看>>
SQL-CLR 类型映射 (LINQ to SQL)
查看>>
org.springframework.orm.hibernate3.support.OpenSessionInViewFilter
查看>>
org.springframework.orm.hibernate3.support.OpenSessionInViewFilter
查看>>
org.springframework.web.multipart.MaxUploadSizeExceededException: Maximum upload size exceeded
查看>>
org.tinygroup.serviceprocessor-服务处理器
查看>>
org/eclipse/jetty/server/Connector : Unsupported major.minor version 52.0
查看>>
org/hibernate/validator/internal/engine
查看>>