单项选择题
给出下列代码,如何使成员变量m被方法fun( )直接访问 class Test private int m; public static void fun( )
…
A.将private int m改为protected int m
B.将private int m改为public int m
C.将private int m改为static i
D.将private int m改为int m
点击查看答案&解析
<上一题
目录
下一题>
热门
试题
单项选择题
已知有下列类的说明,则下列哪个语句是正确的 public class Test private float f = 1.0f; int m = 12; static int n=1; public static void main(String arg[ ]) Test t = new Test( );
A.f;
B.this.n;
C.Test.m;
D.Test.f;
点击查看答案&解析
单项选择题
在oneMethod( )方法运行正常的情况下,程序段将输出什么 public void test( ) try oneMethod( ); System.out.println( condition 1 ); catch (ArrayIndexOutOfBoundsException e) System.out.println( condition 2 ); catch(Exception e) System.out.println( condition 3 ); finally System.out.pritln( finally );
A.condition 1
B.condition 2
C.condition 3
D.condition 1
点击查看答案&解析
相关试题
【11】 日历类提供日期和时间的表示,它...
若x = 5,y = 10,则x > y &...
Java中访问限定符有 【14】 ,protecte...
凡生成StringBuffer一个对象后,还可用 【...
URL是 【10】 的缩写。