A.All of the assert statements are used appropriately.
B.Only the assert statement on line 12 is used appropriately.
C.Only the assert statement on line 15 is used appropriately.
D.Only the assert statement on line 18 is used appropriately.
E.Only the assert statements on lines 12 and 15 are used appropriately.
F.Only the assert statements on lines 12 and 18 are used appropriately.
G.Only the assert statements on lines 15 and 18 are used appropriately.
第1题:
I use jdt(Ver=3.6.2.v_A76_R36x, API=JSL3) to generate a member method or field
I find the output method has no modifiers. setModifier(int) is @Deprecated,
So I use setFlag(int) method.I tried parameter Modifier.PUBLIC, Modifier.ModifierKeyword.PUBLIC_KEYWORD.toFlagValue(), neither works.
Code:
MethodDeclaration md = ast.newMethodDeclaration();
md.setFlags(Modifier.ModifierKeyword.PUBLIC_KEYWORD.toFlagValue());
md.setReturnType2(ast.newPrimitiveType(PrimitiveType.VOID));
// md.setFlags(Modifier.PUBLIC | Modifier.STATIC);
md.setName(ast.newSimpleName("onCreate"));
Output:
void onCreate( ...
Question:
Where public keyword gone? how to add modifier? why ? or a Bug?
装jdk和eclipse,把jdk配置到eclipse里就可以的。
第2题:
第3题:
如下代码中,类 X 的拷贝构造函数的数量是 class X { public: X(); X(int&); X(const X&, int = 1); ~X(); };
第4题:
请写出下面的输出:
class B
{
public:
virtual void Print(void)
{
printf(“B::Print\n”);
}
virtual void Reprint(void)
{
printf(“B:Reprint\n”);
}
void Algo(void)
{
Print();
Reprint();
}
};
class D : public B
{
public:
virtual void Print(void)
{
printf(“D::Print\n”);
}
};
void main()
{
B *p = new D();
p->Print();
p->Algo();
}
第5题:
第6题:
Given: int m=7; float x=2.5, y=4.7; what is the value of the expression of x+m%3* (int) (x+y)%2/4 ().
A.2.500000
B.2.750000
C.3.500000
D.0.000000