JAVA认证格林模拟试题二(下)
来源:优易学  2009-11-28 15:05:50   【优易学:中国教育考试门户网】   资料下载   IT书店
文章页内部300*250广告位


question 51)
given the following code what will be the output?
class valhold{        public int i = 10;}public class obparm{public static void main(string argv[]){        obparm o = new obparm();        o.amethod();        }        public void amethod(){                int i = 99;                valhold v = new valhold();                v.i=30;                another(v,i);                system.out.print( v.i );        }//end of amethod        public void another(valhold v, int i){                i=0;                v.i = 20;                valhold vh = new valhold();                v =  vh;                system.out.print(v.i);        system.out.print(i);        }//end of another}
1) 10030
2) 20030
3) 209930
4) 10020

question 52)
given the following class definition, which of the following methods could be legally placed after the comment
//here public class rid{        public void amethod(int i, string s){}        //here}
1)public void amethod(string s, int i){}
2)public int amethod(int i, string s){}
3)public void amethod(int i, string mystring){}
4) public void amethod(int i, string s) {}

question 53)
given the following class definition which of the following can be legally placed after the comment line
//here ?
class base{public base(int i){}}public class myover extends base{public static void main(string arg[]){                myover m = new myover(10);                }        myover(int i){                super(i);        }        myover(string s, int i){                this(i);                 //here        }}
1)myover m = new myover();
2)super();
3)this("hello",10);
4)base b = new base(10);

question 54)
given the following class definition, which of the following statements would be legal after the comment //here
class inout{string s= new string("between");        public void amethod(final int iargs){       int iam;              class bicycle{                       public void sayhello(){                        //here                        }                }//end of bicycle class        }//end of amethod       public void another(){       int iother;       }}
1) system.out.println(s);
2) system.out.println(iother);
3) system.out.println(iam);
4) system.out.println(iargs);

question 55)
which of the following are methods of the thread class?
1) yield()
2) sleep(long msec)
3) go()
4) stop()

question 56)
which of the following methods are members of the vector class and allow you to input a new element
1) addelement
2) insert
3) append
4) additem

question 57)
which of the following statements are true?
1) adding more classes via import statements will cause a performance overhead, only import classes you actually use.
2) under no circumstances can a class be defined with the private modifier
3) a inner class may under some circumstances be defined with the protected modifier
4) an interface cannot be instantiated

question 58)
which of the following are correct event handling methods
1) mousepressed(mouseevent e){}
2) mousepressed(mouseclick e){}
3) functionkey(keypress k){}
4) componentadded(containerevent e){}

question 59)
which of the following are methods of the collection interface?
1) iterator
2) isempty
3) toarray
4) settext

question 60)
which of the following best describes the use of the synchronized keyword?
1) allows two process to run in paralell but to communicate with each other
2) ensures only one thread at a time may access a method or object
3) ensures that two or more processes will start and end at the same time
4) ensures that two or more threads will start and end at the same time

上一页  [1] [2] [3] 

责任编辑:小草

收藏此页】【 】【打印】【回到顶部
计算机文章页底部500*200广告
文章搜索:
 相关文章
计算机底部580*90广告
文章页右侧第一330*280广告
计算机文章页资讯推荐
热点资讯
文章页330尺寸谷歌广告位
热门课程培训