[单选题]

执行下列方法method(),返回值为( )。 public int method { int num=6; if (num>8) return num; num=7; }

A.编译出错

B.6

C.7

D.8

参考答案与解析:

相关试题

int(-28/6)的返回值为()。

[单选题]int(-28/6)的返回值为()。A .-5B .-3C .-6D .-4

  • 查看答案
  • VB中,Int(2.4)的返回值是()。

    [单选题]VB中,Int(2.4)的返回值是()。A . 2.4B . 3C . 0D . 2

  • 查看答案
  • is a method used in Critical Path Method

    [单选题]is a method used in Critical Path Methodology for constructing a project schedule network diagram that uses boxes or rectangles, referred to as nodes, to represent activities and connects them with arrows that show the logical relationships that exis

  • 查看答案
  • is a method used in Critical Path Method

    [单选题]is a method used in Critical Path Methodology for constructing a project schedule network diagram that uses boxes or rectangles,referred to as nodes,to represent activities and connects them with arrows that show the logical relationships that exist

  • 查看答案
  • 请问Int(3.45)和Int(-3.45)的返回值是什么?()

    [单选题]请问Int(3.45)和Int(-3.45)的返回值是什么?()A .4、-4B .3、-4C .3、3D .3、-3

  • 查看答案
  • 若定义函数int*func(),则函数func的返回值为()。

    [单选题]若定义函数int*func(),则函数func的返回值为( )。A.一个实数B.一个指向整型变量的指针C.一个指向整型函数的指针D.一个整型函数的入口地址

  • 查看答案
  • 求下面函数的返回值(微软)int func(x){int countx = 0;

    [试题]求下面函数的返回值(微软)int func(x){int countx = 0;while(x){countx ++;x = x&(x-1);}return countx;}

  • 查看答案
  • 有一个接口定义如下:interface A{int method1(int i)

    [单选题]有一个接口定义如下: interface A { int method1(int i); int method2(int j);}那么下面各项中实现了该接口并且不是抽象类的是( )。A.class B implements A { intmethod1(){} intmethod2(){} }B.calss B { int method1(int i){) int method2(int j){} }C.class B implementsA { int method1(int i){} int

  • 查看答案
  • 函数fun的返回值是 fun(char * a, char * b) {int

    [单选题]函数fun的返回值是fun(char * a, char * b){int num=0,n=0;while( * (a+num) !='/0') num++;while(b[n] ) { * (a+num) =b[n] ;num++;n++;}return num;}A.字符串a的长度B.字符串b的长度C.字符串a和b的长度之差D.字符串a和b的长度之和

  • 查看答案
  • 下列()选项是main()方法的返回值类型。

    [单选题]下列( )选项是main( )方法的返回值类型。A.intB.voidC.booleanD.static

  • 查看答案
  • 执行下列方法method(),返回值为( )。public int method