搜题
网友您好,请在下方输入框内输入要搜索的题目:
搜题
题目内容 (请给出正确答案)
提问人:网友Litlay 发布时间:2022-01-07
[主观题]

以下C#程序的执行情况是()。using System; namespace aaa { delegate void delep(int i); class

以下C#程序的执行情况是()。using System; namespace aaa { delegate void delep(int i); class Program { public static void Main() { funb(new delep(funa)); } public static void funa(int t) { funb(21); } public static void funb(int i) { Console.WriteLine(i.ToString()); } } }

A、代码中存在错误,delegate void delep(int i);不能定义在名称空间或者类之外

B、代码中存在错误,代码行funb(new delep(funa))使用委托错误

C、程序正常运行,输出为0

D、程序正常运行,输出为21

简答题官方参考答案 (由简答题聘请的专业题库老师提供的解答)
查看官方参考答案
更多“以下C#程序的执行情况是()。using System; namespace aaa { delegate void delep(int i); class”相关的问题
第1题
以下程序的输出结果是( )。using System; using System.Collections; namespace aaa { class Example1 { static void Main() { int s = 0; int[][] a = new int[2][]; //交错数组 a[0] = new int[3] { 1, 2, 3 }; a[1] = new int[4] { 4, 5, 6, 7 }; for (int i = 0; i < a.Length; i++) for (int j = 0; j < a[i].Length; j++) s += a[i][j]; Console.WriteLine(s); } } }

A、1

B、6

C、22

D、28

点击查看答案
第2题
以下程序有没有错误?

class Something {

int i;

public void doSomething(){

System.out.printin("i="+i);

)

}

点击查看答案
第3题
以下程序的运行结果为 class test { public static void main(String args[]) { int x=2; System.out.printf("%d,%d,%d", x++ , x, ++x); } }

A、3,3,3

B、2,3,4

C、2,2,3

D、3,3,4

点击查看答案
第4题
【单选题】在JAVA中,以下程序的输出结果是 class Tetromino{ public void print(){ System.out.println(“打印四个格子所在的坐标”); } } class TetrominoT extends Tetromino { public void print(){ System.out.println(“打印TetrominoT”); } } class Test1 { public static void main(String[] args){ Tetromino t = new TetrominoT(); t.print(); } }

A、打印四个格子所在的坐标

B、打印TetrominoT

C、打印四个格子所在的坐标 打印TetrominoT

D、以上都不对

点击查看答案
第5题
下列程序段的运行结果为( )。 public class Test{ public static void foo(int i){ try{ if(i==1){ throw new Exception(); } System.out.print("1"); }catch(Exception e){ System.out.print("2"); }finally{ System.out.print("3"); } System.out.print("4"); } public static void main(String[] args){ foo(1); } }

A、123

B、234

C、1234

D、编译失败

点击查看答案
第6题
下列程序的执行结果是______。 class T5 implements Runnable { public void run() { int i = 0; While(i<2) { Thread t = Thread.currentThread(); System.out.println(i + t.getName()); i++ } } } public class Testl6 { public static void main(String[] args) { Thread t1 = new Thread(new T5(), "TS"); t1.start (); Thread t = Thread.currentThread(); for(int i = 0; i<3; i++) { System.out.println(I + t.getName()); if(i == 1 && t1.isAlive()) t.yield(); } } }

A.Omain lmam 0T5 1T5 2main

B.Omain lmam 2main

C.Omain lmain 2main 0T5 1T5

D.Omain lmain 0T5 1T5

点击查看答案
第7题
【填空题】请写出以下程序运行结果: public class Main { public Main() { System.out.print("main "); } public Main(String s) { this(); System.out.print("main with "+s); } public static void main(String[] args) { Main main = new Main("wow"); } }
点击查看答案
第8题
以下程序的执行结果是什么?()

int[] myArray=new int[3];try{ for (int i=0; i<= myArray.length; i++){ myArray[i]=i*3 ; System.out.println("myArray 数组的第"+ i +"个元素的值是"+myArray[i]); }} catch (ArrayIndexOutOfBoundsException e) { System.out.println("数组下标越界");}

A、程序出现异常,屏幕提示“数组下标越界”

B、程序执行,显示数组中每个元素的值,最后显示“数组下标越界”

C、程序正常执行结束,屏幕上显示数组中每个元素的值

D、程序编译出错

点击查看答案
第9题

用语言描述下面的程序:using System; using System.Collections.Generic; using System.Text; namespace Graph { class Program { static void Main(string[] args) { circular c = new circular(); Console.WriteLine(c.getSides()); square s = new square(); Console.WriteLine(s.getSides()); Graph g; g= new circular(); Console.WriteLine(g.getSides()); g = new square(); Console.WriteLine(g.getSides()); } } public abstract class Graph { public abstract int getSides(); } public class circular : Graph { public override int getSides() { return 1; } } public class square : Graph { public override int getSides() { return 2; } } }

点击查看答案
第10题
描述C#类中属性与方法的异同。
点击查看答案
重要提示: 请勿将账号共享给其他人使用,违者账号将被封禁!
查看《购买须知》>>>
重置密码
账号:
旧密码:
新密码:
确认密码:
确认修改
购买搜题卡查看答案
购买前请仔细阅读《购买须知》
请选择支付方式
微信支付
支付宝支付
点击支付即表示你同意并接受《服务协议》《购买须知》
立即支付
搜题卡使用说明

1. 搜题次数扣减规则:

功能 扣减规则
基础费
(查看答案)
加收费
(AI功能)
文字搜题、查看答案 1/每题 0/每次
语音搜题、查看答案 1/每题 2/每次
单题拍照识别、查看答案 1/每题 2/每次
整页拍照识别、查看答案 1/每题 5/每次

备注:网站、APP、小程序均支持文字搜题、查看答案;语音搜题、单题拍照识别、整页拍照识别仅APP、小程序支持。

2. 使用语音搜索、拍照搜索等AI功能需安装APP(或打开微信小程序)。

3. 搜题卡过期将作废,不支持退款,请在有效期内使用完毕。

请使用微信扫码支付(元)

订单号:

遇到问题请联系在线客服

请不要关闭本页面,支付完成后请点击【支付完成】按钮
遇到问题请联系在线客服
恭喜您,购买搜题卡成功 系统为您生成的账号密码如下:
重要提示:请勿将账号共享给其他人使用,违者账号将被封禁。
发送账号到微信 保存账号查看答案
怕账号密码记不住?建议关注微信公众号绑定微信,开通微信扫码登录功能
警告:系统检测到您的账号存在安全风险

为了保护您的账号安全,请在“简答题”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!

- 微信扫码关注简答题 -
警告:系统检测到您的账号存在安全风险
抱歉,您的账号因涉嫌违反简答题购买须知被冻结。您可在“简答题”微信公众号中的“官网服务”-“账号解封申请”申请解封,或联系客服
- 微信扫码关注简答题 -
请用微信扫码测试
欢迎分享答案

为鼓励登录用户提交答案,简答题每个月将会抽取一批参与作答的用户给予奖励,具体奖励活动请关注官方微信公众号:简答题

简答题官方微信公众号

简答题
下载APP
关注公众号
TOP