银行卡借给别人使用:我有数道题不懂 请人帮忙

来源:百度文库 编辑:查人人中国名人网 时间:2024/05/14 17:58:28
5 下列不属于面向对象程序设计开发过程的是
A 000 B 00P C 00A D 00B
6
为AB类的一个无形式参数无返回值的方法method()书写方法头,使得使用AV.mothod()就可以调用该方法
A static void method() B public void method() C final void method() D
abstract void method()
7 获取myclass类中的member成员之值哪种方式正确
class myclass{private static int member=1: public static int
getmember(){return member;}}
A myclass.member; B new myclass().member; C myelass.getmember(); D
myclass().getmember();
8 下列各种Java中的构造函数定义,那些是错误的
A class MyClass{public MyClass(){}} B class MyClass{public MyClass(int
x){}} C class MyClass{public int MyClass(){}} D class MyClass{public
MyClass(int x,int y){}}
9 设Derived类为Base类的子类,则如下对象的创建语句中那个是错误的
A Base 0bj=new Derived() B Derived 0bj=new Base() C Base 0bj=new Base()
D Derived 0bj=new Derived()
10 Point类的定义
class Point{private int x,y;public Point (int x,int
y){this.x=x;this.y=y;}}
其中的this代表
A 类名Point B父类的对象 C Point类的当前对象 D this指针
11 给定代码如下
1 class Person{
2 public void printValue(int i, int j) {/*...*/}
3 public void printValue(int i) {/*...*/}
4 }
5 public class Teacher extends Person{
6 public void printValue() {/*...*/}
7 public void printValue(int i) {/*...*/}
8 public static void main(String args[]){
9 Person t = new Teacher();
10 t.printCalue(10);
11 }
12 }
第10行所调用的方法是在第几行定义的:
A 2 B 3 C 6 D 7
12 给定如下代码
class Person {
String name,department;
int age;
public Person(String n){name=n;}
public Person(String n,int a){name=n;age=a;}
public Person(String n,String d, int a){
department = d;
}}
要在第三个构造函数的空白处填上一行代码使之能够调用第二个构造函数,这行代码应该是
A Person(n,a) B this(Person(n,a)} C this(n,a); D this(name,age)
13 给定下列代码
1 class Parent {
2 private String name;
3 public Parent(){}
4 }
5 public class Child extends Parent {
6 private String department;
7 public Child(){}
8 public String getValue(){return name;}
9 public String void main(String arg[]){
10 Parent p=new Parent();
11 }
12 }
上述代码的那些行将会导致错误
A line 3 B line 6 C line 7 D line 8 E line 10
14 给定下列代码
public class person{
static int arr[]=new int[10];
public static void main(String a[]){
System.out.println(arr[1];
}
}
下列说法正确的有 A 编译时将发生错误 B 编译时正确但是运行时出错 C
输出为0 D 输出为null
15 给定下列程序
public class Test{
public static void main(String args[]){
string str=new String("World");
char ch[]={"H","e","l","l","0"};
change(str,ch);
System.out.println(str+"nad"+ch);
}
public static void change(String str,char ch[]){
str="Changed";ch[0]="C";
}}
上述程序的运行结果应该是
A World and Hello B World and Cello C Changed and Hello D Changed
and Cello

这是赛车凭道