题目详情
当前位置:首页 > 职业培训考试
题目详情:
发布时间:2024-05-20 07:39:04

[单选题]下面的方法,当输入为2的时候返回值是多少?() public static int getValue(int i) { int result = 0; switch (i) { case 1: result = result + i; case 2: result = result + i * 2; case 3: result = result + i * 3; } return result; }
A.0
B.2
C.4
D.10

更多"[单选题]下面的方法,当输入为2的时候返回值是多少?() public"的相关试题:

[多选题]某Java类JavaTest有一个方法,此方法包含一个形参,返回值类型为int类型,使用其类名就可以调用其方法,其方法头可能为()
A.static int method(String str)
B.public int method(String str)
C.static void method()  
D.abstract int method(String str)
E.public static int method(String str)
[单选题]public class Console{ public static void Main() { __________________; } }在横线处填入语句,输出为:C# is simple(选一项)
A.Console.PrintLine("C# is simple")
B.Console.WriteLine("C# is simple")
C.WriteLine("C# is simple")
D.Console.Output.WriteLine("C# is simple")
[单选题]下面程序的运行结果:() public static void main(String args[]) { Thread t = new Thread() { public void run() { pong(); } }; t.run(); System.out.print("ping"); } static void pong() { System.out.print("pong"); }
A.pingpong
B.pongping
C.pingpong和pongping都有可能
D.都不输出
[判断题]在一个Java应用程序中main方法必须被说明为 public static void
A.正确
B.错误
[单选题]public static void Main(string[] args) { int i = 2000; object o = i; i = 2001; int j = (int)o; Console.WriteLine("i={0},o={1},j={2}", i, o, j); } 最后输出结果是(选一项)
A.i=2001,o=2000,j=2000
B.i=2001,o=2001,j=2001
C.i=2000,o=2001,j=2000
D.i=2001,o=2000,j=2001
[单选题]当n=5时,下列函数的返回值是:() int foo(int n) { if (n < 2) return n; return foo(n - 1) + foo(n - 2);}
A.5
B.7
C.8
D.10
[单选题]某学员写了如下代码 public static void ShowMsg(){ for (int i = 0; I < 5; i++){ Console.WriteLine("Hello World!"); } } 然后在主主法中调用ShowMsg(),那么按方法的结构,本方法属于下列()的方法
A.有参无返回值
B.无参无返回值
C.无参有返回值
D.有参有返回值
[单选题]已定义以下函数
Fun(int *p)
{ return *p; }
该函数的返回值是()。
A.不确定的值
B.形参p中存放的值
C.形参p所指存储单元中的值
D.形参p的地址值
[单选题]下面程序的输出是()。
Int m=13;
Int fun2(int x,int y)
{ int m=3;
Return(x*y-m);
}
Main( )
{ int a=7,b=5;
Printf("%d\n",fun2(a,b)/m);}
A.1
B.2
C.7
D.10
[单选题]在方法中有一类是有参有返回值的方法,这也是C#中最为复杂的方法, 那么此方法中必不可以的返回值语句,下列不合适的一项为:()
A.return ture;
B.return ;
C.return a+b;
D.return 表达式;
[判断题]极化继电器调试时,宜釆用调整其触点的方法来改变其起动值与返回值。( )
A.正确
B.错误
[多选题]Action类中的符合execute()方法的返回值的有( )
A.SUCCESS
B.”SUCCESS”
C.”success”
D.null
[单选题]Java语言中,String类中的indexOf()方法返回值的类型是( )
A.int
B.double
C.float
D.boolean
[单选题]若有以下函数首部
Int fun(double x[10], int *n)
则下面针对此函数的函数声明语句中正确的是()。
A.int fun(double x, int *n);
B.int fun(double, int );
C.int fun(double *x, int n);
D.int fun(double *, int *);
[单选题]有以下程序
Int a=4;
Int f(int n)
{ int t=0;
Static int a=5;
If(n%2) {int a=6; t+=a++;}
Else {int a=7; t+=a++;}
Return t+a++;
}
Main()
{ int s=a,i=0;
For(;i<2;i++)
S+=f(i);
Printf("%d\n",s);
}
程序运行后的输出结果是()。
A.24
B.28
C.32
D.36
[判断题]http请求get方法执行效率比post方法好
A.正确
B.错误
[单选题]分析下面的C#代码,该程序的运行结果是( ) int index=1; int[] foo=new int[3]; int bar=foo[index]; int baz=bar+index; Console.WriteLine(baz);
A.0
B.1
C.2
D.编译错误

我来回答:

购买搜题卡查看答案
[会员特权] 开通VIP, 查看 全部题目答案
[会员特权] 享免全部广告特权
推荐91天
¥36.8
¥80元
31天
¥20.8
¥40元
365天
¥88.8
¥188元
请选择支付方式
  • 微信支付
  • 支付宝支付
点击支付即表示同意并接受了《购买须知》
立即支付 系统将自动为您注册账号
请使用微信扫码支付

订单号:

请不要关闭本页面,支付完成后请点击【支付完成】按钮
恭喜您,购买搜题卡成功
重要提示:请拍照或截图保存账号密码!
我要搜题网官网:https://www.woyaosouti.com
我已记住账号密码