java题库

2026/4/28 13:37:25

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题库.doc 将本文的Word文档下载到电脑
搜索更多关于: java题库 的文档
相关推荐
相关阅读
× 游客快捷下载通道(下载后可以自由复制和排版)

下载本文档需要支付 10

支付方式:

开通VIP包月会员 特价:29元/月

注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信:xuecool-com QQ:370150219