无忧首页企业系统我的无忧
无忧服务:
兼职活动培训
娱乐交友:
交友社区资讯
全职实习:
实习暑假寒假
微信号:school51
扫一下,立即关注
加关注
在线支付,立省10元
下载新版APP
===大学生成长生活平台===

JAVA题库:格林模拟试题三(下)(2)

2012-12-26来源/作者:卫凯点击次数:552

 

question 35)

what will happen when you attempt to compile and run the following code

public class borley extends thread{
    public static void main(string argv[]){
        borley b = new borley();
        b.start();
    }
    public void run(){      
        system.out.println("running");
    }
}

1) compilation and run but no output
2) compilation and run with the output "running"
3) compile time error with complaint of no thread target
4) compile time error with complaint of no access to thread package


question 36)

assuming any exception handling has been set up, which of the following will create an instance of the randomaccessfile class

1) randomaccessfile raf=new randomaccessfile("myfile.txt","rw");
2) randomaccessfile raf=new randomaccessfile( new datainputstream());
3) randomaccessfile raf=new randomaccessfile("myfile.txt");
4) randomaccessfile raf=new randomaccessfile( new file("myfile.txt"));


question 37)

given the following class definition

public class upton{
public static void main(string argv[]){     
        }
        public void amethod(int i){}
        //here
}

which of the following would be legal to place after the comment //here ?
1) public int amethod(int z){}
2) public int amethod(int i,int j){return 99;}
3) protected void amethod(long l){ }
4) private void anothermethod(){}





相关阅读



关于我们 | 联系我们 | 用户指南 | 网站地图 | 意见建议 | 会员注册 | 用户协议 | 隐私政策