内容发布更新时间 : 2025/5/22 3:23:15星期一 下面是文章的全部内容请认真阅读。
C)if__else语句的嵌套 D)do__while语句 6.以下语句中是循环语句的是( )。
A)break 语句 B)switch 语句 C)if 语句 D)do - while 语句 7.以下语句中不能构成循环的语句是( )。
A) for 语句 B) while 语句 C) switch 语句 D) do__while 语句 8.能从循环语句的循环体中跳出的语句是( )。
A)for语句 B)break语句 C) continue语句 D)return语句
3.B 4.C 5.C 6.D 7.C 8.B
1.下列方法定义中,正确的是( )。 A) int x( int a,b ) { return (a-b); } B) double x( int a,int b) { int w; w=a-b; } C) double x( a,b ) { return b; } D) int x( int a,int b) { return a-b; } 2.下列方法定义中,正确的是( )。 A) void x( int a,int b ); { return (a-b); } B) x( int a,int b) { return a-b; }
C) double x { return b; } D) int x( int a,int b) { return a+b; }
3.下列方法定义中,不正确的是( )。 A) float x( int a,int b ) { return (a-b); } B) int x( int a,int b) { return a-b; }
C) int x( int a,int b ); { return a*b; } D) int x(int a,int b) { return 1.2*(a+b); } 4.下列方法定义中,正确的是( )。 A) int x( ){ char ch='a'; return (int)ch; } B) void x( ){ ...return true; } C) int x( ){ ...return true; } D) int x( int a, b){ return a+b; }
5.列方法定义中,方法头不正确的是( )。 A)public int x( ){ ...}
B)public static int x( double y ){ ...} C)void x( double d ) { ...}
D)public static x( double a ){ ...}
1.D 2.D 3.D 4.A 5.D
2.在某个类中存在一个方法: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)
3.在某个类中存在一个方法: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) 4.为了区分类中重载的同名的不同方法,要求(