第一范文网 - 专业文章范例文档资料分享平台

java题库

来源:用户分享 时间:2025/5/16 15:35:31 本文由loading 分享 下载这篇文档手机版
说明:文章内容仅供预览,部分内容可能不全,需要完整文档或者需要复制内容,请下载word后使用。下载word有问题请添加微信号:xxxxxxx或QQ:xxxxxx 处理(尽可能给您提供完整文档),感谢您的支持与谅解。

System.out.println(\ }

public static void main(String argv[]){ Abs a = new Abs(); } }

10. 编译并运行下面程序,分析结果(继承,最终方法,无错) class Base{

public final void amethod(){

System.out.println(\ } }

public class Fin extends Base{

public static void main(String argv[]){ Base b = new Base(); b.amethod(); } }

11. 编译并运行下面程序,分析结果(最终方法不能被覆盖重写) class Base{

public final void amethod(){

System.out.println(\ } }

public class Fin extends Base{

public void amethod(){

System.out.println(\ }

public static void main(String argv[]){ Base b = new Base(); b.amethod(); }

12. 编译并运行下面程序,分析结果(构造方法为私有访问权限,只有该类有主方法时才能

运行, 此题没错,输入1至9) public class Hope{

public static void main(String argv[]){ Hope h = new Hope(); }

private Hope(){ for(int i =0; i <10; i ++){

System.out.println(i); }

} }

13. 编译并运行下面程序,分析结果( 主方法参数为字符串数组,而不是字符串) public class MyMain{

public static void main(String argv){

System.out.println(\ } }

14. 编译并运行下面程序,分析结果(类的访问权限不能为private) private class Base{} public class Vis{

transient int iVal;

public static void main(String elephant[]){ } }

15. 编译并运行下面程序,分析结果(数组下标越界) public class MyAr{

public static void main(String argv[]){ int[] i = new int[5];

System.out.println(i[5]); } }

16. 编译并运行下面程序,分析结果(静态方法不能访问非静态数据) public class Arg{

String[] MyArg;

public static void main(String argv[]){ MyArg=argv; }

public void amethod(){

System.out.println(argv[1]); } }

17. 编译并运行下面程序,分析结果(字符比较:==是比较地址) public class StrEq{

搜索更多关于: java题库 的文档
java题库.doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印
本文链接:https://www.diyifanwen.net/c5tyjr2a2hj3pit886asl2xn8u9whjn0047i_13.html(转载请注明文章来源)
热门推荐
Copyright © 2012-2023 第一范文网 版权所有 免责声明 | 联系我们
声明 :本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
客服QQ:xxxxxx 邮箱:xxxxxx@qq.com
渝ICP备2023013149号
Top