Which code determines the int value foo closest to a double 

题目
单选题
Which code determines the int value foo closest to a double value bar?()
A

 Int foo = (int) Math.max(bar);

B

 Int foo = (int) Math.min(bar);

C

 Int foo = (int) Math.abs(bar);

D

 Int foo = (int) Math.ceil(bar);

E

 Int foo = (int) Math.floor(bar);

F

 Int foo = (int) Math.round(bar);

如果没有搜索结果或未解决您的问题,请直接 联系老师 获取答案。
相似问题和答案

第1题:

Given:Which three methods, inserted individually at line 14, will correctly complete class Two?()

A.int foo() { /* more code here */ }

B.void foo() { /* more code here */ }

C.public void foo() { /* more code here */ }

D.private void foo() { /* more code here */ }

E.protected void foo() { /* more code here */ }


参考答案:B, C, E

第2题:

Given: 3.public class MyTagHandler extends TagSupport { 4.public int doStartTag() { 5.// insert code here 6.// return an int 7.} 8.// more code here ... 18.} There is a single attribute foo in the session scope. Which three code fragments,inserted independently atline 5,return the value of the attribute?()

  • A、Object o = pageContext.getAttribute("foo");
  • B、Object o = pageContext.findAttribute("foo");
  • C、Object o = pageContext.getAttribute("foo",PageContext.SESSION_SCOPE);
  • D、HttpSession s = pageContext.getSession();Object o = s.getAttribute("foo");

正确答案:B,C,D

第3题:

有如下类定义:

class Foo

{

public:

Foo(int v):value(v){} // ①

~Foo(){} // ②

private:

Foo(){} // ③

int value = 0; // ④

};

其中存在语法错误的行是

A . ①

B . ②

C . ③

D . ④


正确答案:D

第4题:

Which JSTL code snippet can be used to perform URL rewriting?()

  • A、<a href=’<c:url url="foo.jsp"/>’ />
  • B、<a href=’<c:link url="foo.jsp"/>’ />
  • C、<a href=’<c:url value="foo.jsp"/>’ />
  • D、<a href=’<c:link value="foo.jsp"/>’ />

正确答案:C

第5题:

int index = 1;   String test = new String;   String foo = test[index];  What is the result?()

  • A、  Foo has the value “”
  • B、 Foo has the value null
  • C、 An exception is thrown
  • D、 The code will not compile

正确答案:B

第6题:

Given:Which code, inserted at line 15, allows the class Sprite to compile?()

A.Foo { public int bar() { return 1; }

B.new Foo { public int bar() { return 1; }

C.new Foo() { public int bar() { return 1; }

D.new class Foo { public int bar() { return 1; }


参考答案:C

第7题:

class One {  void foo() {}  }  class Two extends One {   //insert method here  }  Which three methods, inserted individually at line 14, will correctly complete class Two?()

  • A、 int foo() { /* more code here */ }
  • B、 void foo() { /* more code here */ }
  • C、 public void foo() { /* more code here */ }
  • D、 private void foo() { /* more code here */ }
  • E、 protected void foo() { /* more code here */ }

正确答案:B,C,E

第8题:

( 10 )已知下列程序的输出结果是 42 ,请将画线处缺失的部分补充完整。

#include

using namespace std;

class Foo {

int value;

public:

Foo( ) : value(0) {}

void setValue(int value)

{ 【 10 】 = value; // 给 Foo 的数据成员 value 赋值 }

void print( ) { cout << value; }

};

int main( )

{

Foo f;

f.setValue(42);

f.print();

return 0;

}


正确答案:

第9题:

Which code determines the int value foo closest to a double value bar?()  

  • A、 Int foo = (int) Math.max(bar);
  • B、 Int foo = (int) Math.min(bar);
  • C、 Int foo = (int) Math.abs(bar);
  • D、 Int foo = (int) Math.ceil(bar);
  • E、 Int foo = (int) Math.floor(bar);
  • F、 Int foo = (int) Math.round(bar);

正确答案:F

第10题:

int index = 1;   boolean test = new Boolean;   boolean foo= test [index];  What is the result?()

  • A、 Foo has the value of 0.
  • B、 Foo has the value of null.
  • C、 Foo has the value of true.
  • D、 Foo has the value of false.
  • E、 An exception is thrown.
  • F、 The code will not compile.

正确答案:D

更多相关问题