TOP

2008年4月笔试试卷及参考答案(三)
2012-07-15 21:37:37 来源: 作者: 【 】 浏览:863次 评论:0
微信搜索关注"91考试网"公众号,领30元,获取公务员、事业编、教师等考试资料40G!
nbsp; public class MorePrimesTest{

          public static void main(String[]args){

            long[]primes=new long[20];

            primes[0]2L;

            primes[1]3L;

            long number=5L;

              outer:

            for(int count=2; count<primes. length; number+ =2L){

                 long limit=(long)Math. ceil(Math. sqrt((double)number));

                   for(int i=1; i<count && primes[i]<limit; i+ +){

                      if(number______primes[i]==0L){

                         cotinue outer;

                      }

                   }

                 for(int j=0; j<primes. length; j ++){

                      long n=primes[j];

                      System. out. println(n);

                 }

            }

        }

    在程序下画线处填入的正确选项是

    A) &    B) *    C) /         D) %

    (24)接口中,除了抽象方法之外,还可以含有

    A) 变量    B) 常量    C) 成员方法    D) 构造方法

    (25)StringBuffer类字符串对象的长度是

    A) 固定    B) 必须小于16个字符

    C) 可变    D) 必须大于16个字符

    (26)阅读下面写文件的程序

             import java. io. *;

             public class WriteFile{

               public static void main(String[]A) {

         &n

Tags: 责任编辑:91kaoshiwang
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇2007年9月全国计算机等级考试二级.. 下一篇2007年9月全国计算机等级考试二级..

相关栏目

最新文章

推荐文章

网站客服QQ: 960335752 - 14613519 - 48225117