Which three form part of correct array declarations?()
第1题:
若有以下程序: #include<iostream> using namespace std; class A { private: int a; public: void seta(int x) { a=x; } void showa() { cout<<a<<","; } }; class B { private: int b; public: void setb(int x) { b=x; } void showb() { cout<<b<<",”; } }; class C:pUblic A,private B { private: int c; public: void setc(int x,int y,int z) { c=z; seta(x); setb(y); } void showc() { showa(); showb(); cout<<c<<end1; } }; int main() { Cc; c.setc(1,2,3); c.showc(); retrun 0; } 程序执行后的输出结果是
A.1,2,3
B.1,1,1
C.2,2,2
D.3,3,3
第2题:
A.final int num1 = 10;
B.static int num2 = 20;
C.abstract int num3 = 30;
D.private int num4 = 40;
第3题:
public interface Foo{ int k = 4; } Which three are equivalent to line 2?()
第4题:
Given: 1. public class Method Over { 2. public void set Var (int a, int b, float c) { 3. } 4. } Which two overload the set Var method()?
第5题:
Given the following code, which method declarations, when inserted at the indicated position, will not cause the program to fail compilation?() public class Qdd1f { public long sum(long a, long b) { return a + b; } // insert new method declaration here }
第6题:
下列选项中可以替换所给代码中第2行的有()。
第7题:
Given: 1. public interface Foo { 2. int k = 4: 3. } Which three are equivalent to line 2?()
第8题:
Given: 1. public class ConstOver { 2. public constOver(int x, int y, int z) { 3. } 4. } Which two overload the ConstOver Constructor?()
第9题:
public class MethodOver { public void setVar (int a, int b, float c) { } } Which two overload the setVar method?()
第10题:
public interface Foo{ int k = 4; } Which three are equivalent to line 2? ()
第11题:
public int a []
static int [] a
public [] int a
private int a [3]
private int [3] a []
public final int [] a
第12题:
( 难度:中等)下面哪个函数是 public void example(){...} 的重载函数?
A.private void example( int m){...}
B.public int example(){...}
C.public void example2(){...}
D.public int example ( int m, float f){...}
E.public int example ( int m, float f, int cc){...}
答案:DE
第13题:
下面哪个方法是 public void example(){...} 的重载方法?
A、private void example( int m){...}
B、public int example(){...}
C、public void example2(){...}
D、public int example(int m, float f){...}
第14题:
class A { protected int method1(int a, int b) { return 0; } } Which two are valid in a class that extends class A?()
第15题:
Which lines of code are valid declarations of a native method when occurring within the declaration of the following class?() public class Qf575 { // insert declaration of a native method here }
第16题:
public interface Foo { int k = 4; 3. } Which three are equivalent to line 2?()
第17题:
现有: public class TestDemo{ private int X-2; static int y=3; public void method(){ final int i=100; int j =10; class Cinner { public void mymethod(){ //Here } } } } 在Here处可以访问的变量是哪些?()
第18题:
public class TestDemo{ private int x = 2; static int y = 3; public void method(){ final int i=100; int j = 10; class Cinner{ public void mymethod(){ //Here } } } } 在Here处可以访问的变量是哪些?()
第19题:
public class ConstOver { public ConstOver (int x, int y, int z) { } } Which two overload the ConstOver constructor?()
第20题:
public class MethodOver { private int x, y; private float z; public void setVar(int a, int b, float c){ x = a; y = b; z = c; } } Which two overload the setVar method?()
第21题:
public class Parent { int change() {…} } class Child extends Parent { } Which methods can be added into class Child?()
第22题:
public abstract class Shape { private int x; private int y; public abstract void draw(); public void setAnchor(int x, int y) { this.x = x; this.y = y; } } Which two classes use the Shape class correctly?()
第23题:
public class Circle implements Shape { private int radius; }
public abstract class Circle extends Shape { private int radius; }
public class Circle extends Shape { private int radius; public void draw(); }
public abstract class Circle implements Shape { private int radius; public void draw(); }
public class Circle extends Shape { private int radius;public void draw() {/* code here */} }
public abstract class Circle implements Shape { private int radius;public void draw() { / code here */ } }