()是作为void getSort(int x)方法的重载方法。
A. public getSort(float x)
B. int getSort(int y)
C. double getSort(int x, int y)
D. void get(int x, int y)
查看答案
()不能作为void sort(int x)方法的重载方法。
A. public float sort(float x)
B. int sort(int y)
C. double sort(int x, int y)
D. void sort(double y)
为了区分重载方法,要求()。
A. 采用不同的形式参数列表
B. 返回值类型不同
C. 调用时用类名或对象名做前缀
D. 参数名不同
写出程序的运行结果:public class A{protected void test(float x){System.out.println("test(float):" + x);}protected void test(Object obj){System.out.println("test(Object):" + obj );}protected void test(String str){System.out.println("test(String):" + str );}public static void main(String[] args){A a1 = new A( );a1.test( "hello" );a1.test( 5 );}}
(1+X)关于 this 的描述,哪一个是错误的( )?
A. this 可以用于区分成员变量和局部变量。
B. this 可以用于调用其他构造方法。
C. 在同一个构造方法中,可以使用两次 this() 调用其他两个构造方法。
D. 在使用 this 调用其他构造方法时,要避免多个构造方法之间的无限循环现象。