网友您好, 请在下方输入框内输入要搜索的题目:
题目内容
(请给出正确答案)
public class returnIt ( returnType methodA(byte x, double y) ( return (short) x/y * 2; ) ) What is the valid returnType for methodA in line 2?()
- A、 Int
- B、 Byte
- C、 Long
- D、 Short
- E、 Float
- F、 Double
参考答案
更多 “ public class returnIt ( returnType methodA(byte x, double y) ( return (short) x/y * 2; ) ) What is the valid returnType for methodA in line 2?()A、 IntB、 ByteC、 LongD、 ShortE、 FloatF、 Double” 相关考题
考题
下列程序片段中,能通过编译的是A.public abstract class Animal{ public void speak();}B.public abstract class Animal{ public void speak(){}}C.public class Animal{ public abstract void speak();}D.public abstract class Animal{ public abstract void speak(){}}
考题
下列虚基类的声明中正确的是( )。A.class virtual B:public AB.virtual class B:public AC.class B:public A virtualD.class B:virtual public A
考题
Given:Which two, inserted at line 11, will allow the code to compile?()
A.public class MinMax? {B.public class MinMax? extends Number {C.public class MinMaxN extends Object {D.public class MinMaxN extends Number {E.public class MinMax? extends Object {F.public class MinMaxN extends Integer {
考题
下列程序片段中,能通过编译的是( )。A.public abstract class Animal{public void speak( );}B.public abstract class Animal{public void speak( ){};}C.public class Animal{pubilc abstract void speak( );}D.public abstract class Animal{pubile abstract void speak( ){};}
考题
下列程序片段中,能通过编译的是( )。 A.public abstract class Animal{ public void speak;}S
下列程序片段中,能通过编译的是( )。A.public abstract class Animal{ public void speak;}B.public abstract class Animal{ public void speak{);}C.public class Animal{ pubilc abstract void speak;}D.public abstract class Animal{ pubile abstract void speak{};}
考题
public class SomeException { } Class a: public class a { public void doSomething() { } } Class b: public class b extends a { public void doSomething() throws SomeException { } } Which is true about the two classes?() A、 Compilation of both classes will fail.B、 Compilation of both classes will succeed.C、 Compilation of class a will fail. Compilation of class b will succeed.D、 Compilation of class a will fail. Compilation of class a will succeed.
考题
1. public class ReturnIt { 2. return Type methodA(byte x, double y) { 3. return (long)x / y * 2; 4. } 5. } What is the narrowest valid returnType for methodA in line2?() A、 intB、 byteC、 longD、 shortE、 floatF、 double
考题
Which three demonstrate an “is a” relationship?() A、 public class X { } public class Y extends X { }B、 public interface Shape { } public interface Rectangle extends Shape{ }C、 public interface Color { } public class Shape { private Color color; }D、 public interface Species { } public class Animal { private Species species; }E、 public class Person { } public class Employee { public Employee(Person person) { }F、 interface Component { } class Container implements Component { private Component[] children; }
考题
interface Data { public void load(); } abstract class Info { public abstract void load(); } Which class correctly uses the Data interface and Info class?() A、 public class Employee extends Info implements Data { public void load() { /*do something*/ } }B、 public class Employee implements Info extends Data { public void load() { /*do something*/ } }C、 public class Employee extends Info implements Data { public void load() { /*do something */ } public void Info.load() { /*do something*/ } }D、 public class Employee implements Info extends Data { public void Data.load() { /*dsomething */ } public void load() { /*do something */ } }E、 public class Employee implements Info extends Data { public void load() { /*do something */ } public void Info.load(){ /*do something*/ } }F、 public class Employee extends Info implements Data{ public void Data.load() { /*do something*/ } public void Info.load() { /*do something*/ } }
考题
Which two allow the class Thing to be instantiated using new Thing()?A、 public class Thing { }B、 public class Thing { public Thing() {} }C、 public class Thing { public Thing(void) {} }D、 public class Thing { public Thing(String s) {} }E、 public class Thing { public void Thing() {} public Thing(String s) {} }
考题
在C#程序中,如果类B要继承类A,类B正确的定义为()。A、public class B inherit AB、public class B :: AC、public class B : AD、public class B from A
考题
package geometry; public class Hypotenuse { public InnerTriangle it = new InnerTriangle(); class InnerTriangle { public int base; public int height; } } Which is true about the class of an object that can reference the variable base? ()A、 It can be any class.B、 No class has access to base.C、 The class must belong to the geometry package.D、 The class must be a subclass of the class Hypotenuse.
考题
1. public class returnIt ( 2. returnType methodA(byte x, double y) ( 3. return (short) x/y * 2; 4. ) 5. ) What is the valid returnType for methodA in line 2?() A、 IntB、 ByteC、 LongD、 ShortE、 FloatF、 Double
考题
Which the two demonstrate an “is a” relationship?()A、 public interface Person {} Public class Employee extends Person {}B、 public interface Shape {} public interface Rectangle extends Shape {}C、 public interface Color {} public class Shape { private Color color; }D、 public class Species {} public class Animal { private Species species; }E、 interface Component {} Class Container implements Component {private Component [] children;
考题
Which two demonstrate an “is a” relationship?() A、 public interface Person { } public class Employee extends Person { }B、 public interface Shape { } public class Employee extends Shape { }C、 public interface Color { } public class Employee extends Color { }D、 public class Species { } public class Animal (private Species species;)E、 interface Component { } Class Container implements Component ( Private Component[ ]children; )
考题
public class Plant { private String name; public Plant(String name) { this.name = name; } public String getName() { return name; } } public class Tree extends Plant { public void growFruit() { } public void dropLeaves() { } } Which is true?() A、 The code will compile without changes.B、 The code will compile if public Tree() { Plant(); } is added to the Tree class.C、 The code will compile if public Plant() { Tree(); } is added to the Plant class.D、 The code will compile if public Plant() { this(”fern”); } is added to the Plant class.E、 The code will compile if public Plant() { Plant(”fern”); } is added to the Plant class.
考题
What produces a compiler error?() A、 class A { public A(int x) {} }B、 class A {} class B extends A { B() {} }C、 class A { A() {} } class B { public B() {} }D、 class Z { public Z(int) {} } class A extends Z {}
考题
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?()A、 public class Circle implements Shape { private int radius; }B、 public abstract class Circle extends Shape { private int radius; }C、 public class Circle extends Shape { private int radius; public void draw(); }D、 public abstract class Circle implements Shape { private int radius; public void draw(); }E、 public class Circle extends Shape { private int radius;public void draw() {/* code here */} }F、 public abstract class Circle implements Shape { private int radius;public void draw() { / code here */ } }
考题
单选题public class returnIt ( returnType methodA(byte x, double y) ( return (short) x/y * 2; ) ) What is the valid returnType for methodA in line 2?()A
IntB
ByteC
LongD
ShortE
FloatF
Double
考题
单选题interface Data { public void load(); } abstract class Info { public abstract void load(); } Which class correctly uses the Data interface and Info class?()A
public class Employee extends Info implements Data { public void load() { /*do something*/ } }B
public class Employee implements Info extends Data { public void load() { /*do something*/ } }C
public class Employee extends Info implements Data { public void load() { /*do something */ } public void Info.load() { /*do something*/ } }D
public class Employee implements Info extends Data { public void Data.load() { /*dsomething */ } public void load() { /*do something */ } }E
public class Employee implements Info extends Data { public void load() { /*do something */ } public void Info.load(){ /*do something*/ } }F
public class Employee extends Info implements Data{ public void Data.load() { /*do something*/ } public void Info.load() { /*do something*/ } }
考题
多选题Which three demonstrate an “is a” relationship?()Apublic class X { } public class Y extends X { }Bpublic interface Shape { } public interface Rectangle extends Shape{ }Cpublic interface Color { } public class Shape { private Color color; }Dpublic interface Species { } public class Animal { private Species species; }Epublic class Person { } public class Employee { public Employee(Person person) { }Finterface Component { } class Container implements Component { private Component[] children; }
考题
单选题package geometry; public class Hypotenuse { public InnerTriangle it = new InnerTriangle(); class InnerTriangle { public int base; public int height; } } Which is true about the class of an object that can reference the variable base? ()A
It can be any class.B
No class has access to base.C
The class must belong to the geometry package.D
The class must be a subclass of the class Hypotenuse.
考题
单选题public class SomeException { } Class a: public class a { public void doSomething() { } } Class b: public class b extends a { public void doSomething() throws SomeException { } } Which is true about the two classes?()A
Compilation of both classes will fail.B
Compilation of both classes will succeed.C
Compilation of class a will fail. Compilation of class b will succeed.D
Compilation of class a will fail. Compilation of class a will succeed.
考题
多选题Which two allow the class Thing to be instantiated using new Thing()?Apublic class Thing { }Bpublic class Thing { public Thing() {} }Cpublic class Thing { public Thing(void) {} }Dpublic class Thing { public Thing(String s) {} }Epublic class Thing { public void Thing() {} public Thing(String s) {} }
考题
单选题public class Plant { private String name; public Plant(String name) { this.name = name; } public String getName() { return name; } } public class Tree extends Plant { public void growFruit() { } public void dropLeaves() { } } Which is true?()A
The code will compile without changes.B
The code will compile if public Tree() { Plant(); } is added to the Tree class.C
The code will compile if public Plant() { Tree(); } is added to the Plant class.D
The code will compile if public Plant() { this(”fern”); } is added to the Plant class.E
The code will compile if public Plant() { Plant(”fern”); } is added to the Plant class.
考题
单选题What produces a compiler error?()A
class A { public A(int x) {} }B
class A {} class B extends A { B() {} }C
class A { A() {} } class B { public B() {} }D
class Z { public Z(int) {} } class A extends Z {}
考题
单选题1. public class ReturnIt { 2. return Type methodA(byte x, double y) { 3. return (long)x / y * 2; 4. } 5. } What is the narrowest valid returnType for methodA in line2?()A
intB
byteC
longD
shortE
floatF
double
热门标签
最新试卷