下述哪一组方法,是一个类中方法重载的正确写法?( )
A. int addValue( int a, int b ){return a+b;}float addValue ( float a, float b) {return a+b;}
B. int addValue (int a, int b ){value=a+b; }float addValue ( int a, int b) {return (float)(a+b);}
C. int addValue( int a, int b ){return a+1;}int addValue ( int a, int b) {return a+b;}
D. int addValue( int a, int b ) {return a+b;}int addValue ( int x, int y ) {return x+y;}
阅读以下程序:classAA{doublex=1.1;doublemethod(){returnx;}}classBBextendsAA{doublex=2.2;doublemethod(){returnx;}publicstaticvoidmain(Stringargs[]){AAa=newBB();System.out.println(a.x);}}程序的输出结果是:()
A. 1.1
B. 2.2
C. 0
D. 编译出错
阅读以下程序代码:classAA{doublex=1.1;doublemethod(){returnx;}}classBBextendsAA{doublex=2.2;doublemethod(){returnx;}publicstaticvoidmain(Stringargs[]){AAa=newBB();System.out.println(a.method());}}程序的输出结果是()。
A. 1.1
B. 2.2
C. 0
D. 编译出错
使用下列哪个关键字,可以判断一个变量的具体类型()?
A. as
B. is
C. instanceof
D. extends