java 将日期转化为格林时间_JAVA题库:格林模拟试题二(上)(4)

JAVA认证试题集锦 2021-07-17 网络整理 可可

【shitiku.jxxyjl.com--JAVA认证试题集锦】

question 10)you want to find out the value of the last element of an array. you write the following code. what will happen when you compile and run it.?

public class myar{
public static void main(string argv[]){
int[] i = new int[5];
system.out.println(i[5]);
}
}
1) an error at compile time
2) an error at run time
3) the value 0 will be output
4) the string "null" will be output

question 11)you want to loop through an array and stop when you come to the last element. being a good java programmer and forgetting everything you ever knew about c/c++ you know that arrays contain information about their size. which of the following can you use?

1)myarray.length();
2)myarray.length;
3)myarray.size
4)myarray.size();

question 12)what best describes the appearance of an application with the following code?

import java.awt.*;
public class flowap extends frame{
public static void main(string argv[]){
    flowap fa=new flowap();
    fa.setsize(400,300);
    fa.setvisible(true);

}

flowap(){
        add(new button("one"));
        add(new button("two"));
        add(new button("three"));
        add(new button("four"));
    }//end of constructor



}//end of application

1) a frame with buttons marked one to four placed on each edge.
2) a frame with buutons marked one to four running from the top to bottom
3) a frame with one large button marked four in the centre
4) an error at run time indicating you have not set a layoutmanager

本文来源:https://shitiku.jxxyjl.com/javarenzhengshitijijin/6456.html

Copyright @ 2011- 考试题库网 All Rights Reserved. 版权所有

免责声明 :本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。

 站长统计