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

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

微信搜索关注"91考试网"公众号,领30元,获取事业编教师公务员等考试资料40G
nbsp;   67        65

       2        1          2         1

       2.5      3.125      2.5       3.125

    (15)switch语句中表达式(expression)的值不允许用的类型是

    A) byte

    B) int

    C) boolean

    D) char

    (16)下列语句能给数组赋值而不使用for循环的是

    A) myArray{[1]="One";[2]="Two";[3]="Three";}

    B) String s[5]=new String[]{"Zero", "One", "Two", "There", "Four"};

    C) String s[]=new String[]{"Zero", "One", "Two", "There", "Four"};

    D) String s[]=new String[]=|"Zero", "One", "Two", "There", "Four"};

    (17)Swing与AWT相比新增的布局管理器是

    A) CardLayout    B) CardLayout    C) CardBagLayout     D) BoxLayout

    (18)下列语句中正确的是

    A) System. out. println(1+'1');    B) int i=2+"2";

    C) Sting s="on"+'ong';          D) byte b=257;

    (19)下列关键字中可以表示常量的是

    A) final    B) default

    C) private    D) transient

    (20)在Java语言中,被称为内存分配的运算符是

    A) new    B) instance of    C) []      D) ()

    (21)阅读下面程序

         pubic class Cycle{

           public static void main(String args[]){

             System. out. println(args[0]);

    在命令行中输入java Cycle one two,该程序输出结果是

    A) Cycle    B) one

    C) two    D) 上述A、B、C、均不对

    (22)阅读下面程序

        public class My Val{

          public static void main(String args[]){

            My Val m=new My Val();

            m. amethod();

          }

          public void amethod(){

            boolean b[]=new Boolean[5];

          }

        }

    程序编译或运行结果是

    A) 1    B) null    C) " "    D) 编译不能过

    (23)阅读下面求质数的程序

        import java. lang. Math. * ;

      &


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

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