Int
Byte
Long
Short
Float
Double
第1题:
methodA(byte x,double y){return (short)x/y*2;}下划线上应填写的关键字是( )。
A、byte
B、double
C、short
D、float
第2题:
Which will declare a method that is available to all members of the same package and can be referenced without an instance of the class?()
第3题:
下列程序的执行结果为【 】。
include <iostream. h>
class Point
{
public:
Point(double i, double j) { x=i; y=j;}
double Area() const { return 0.0;}
private:
double x, y;
};
class Rectangle: public Point
{
public:
Rectangle(double i, double j, double k, double 1)
double Area() const {return w * h;}
private:
double w, h;
};
Rectangle: :Rectangle(double i, double j, double k. double 1): Point(i,j).
{
w=k, h=1
}
void fun(Point &s)
{
cout<<s. Area()<<end1;
}
void main( )
{
Rectangle rec(3.0, 5.2, 15.0. 25.0);
fun(rec)
}
第4题:
Which will declare a method that forces a subclass to implement it? ()
第5题:
public class TestA{ public void methodA() throws IOException{ //…… } } public class TestB extends TestA{ public void methodA() throws EOFException{ //…… } } public class TestC extends TestA{ public void methodA() throws Exception{ //…… } } 当编译类TestC的时候,结果是哪项?()
第6题:
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?()
第7题:
Which will declare a method that is available to all members of the same package and be referenced without an instance of the class?()
第8题:
有如下两个类定义: class XX{ private: double xl; protected: double x2; public: double x3; }; class YY:protected XX{ private: double yl; protected: double y2; public: double y3; 在类YY中保护成员变量的个数是( )。
A.1
B.2
C.3
D.4
第9题:
Which two are valid declarations within an interface definition?()
第10题:
在接口中以下哪条定义是正确的?()