在下列代码中,有( )处实现了拆箱。 int score=5; object o= score; o=10; score =(int)o; object oScore = score;
举一反三
- Which method will complete this class?() A: public int compareTo(Object o){/* more code here */} B: public int compareTo(Score other){/* more code here */} C: public int compare(Score s1, Score s2){/* more code here */} D: public int compare(Object o1, Object o2){/* more code here */}
- 下列关于数组的静态初始化语句,正确的是( ) A: int [] score =new int[]{1,2,3,4,5}; B: int [] score=new int[5]{1,2,3,4,5}; C: int [5] score=new int[]{1,2,3,4,5}; D: int [5] score=new int[5]{1,2,3,4,5};
- 定义一个存储5个学生成绩的数组不正确的是() A: int[] score = new int[5]; B: int score[] = new int[5]; C: double[] score; score = new double[5]; D: double[] score = new double[];
- 以下有关类的声明,正确的是 A: class Student(object) def __init__(self, name, score): self.name = name self.score = score B: class Student(object) def __init__(self, name, score) self.name = name self.score = score C: class Student(object): def __init__(self, name, score): self.name = name self.score = score D: class Student(object): def __int__(self, name, score): self.name = name self.score = score
- 若有定义int score[10];,则对score数组中的元素的正确引用是( ) A: score[10] B: score[6.0] C: score[0] D: score(7)