2008年4月笔试试卷及参考答案(二)

时间:2012-07-15 21:37:37

微信搜索关注"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


首页 上页 1 2 3 下页 尾页 2/9/9
微信搜索关注"91考试网"公众号,领30元,获取公务员事业编教师考试资料40G
【省市县地区导航】【考试题库导航】

电脑版  |  手机版  |  返回顶部