本文介绍了我需要知道这段代码中关键字返回的功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,我是初学者
我需要在此代码中知道关键字return的功能

hii every one ,i''m beginner
i need to know the function of keyword return in this code

catch (IOException exc)
       {
           Console.WriteLine(exc.Message);
           return;
       }

推荐答案



private void MyMethod(int value)
    {
    if (value < 0)
        return;
    Console.WriteLine(value);
    }

如果使用正数或零参数调用MyMethod,它将打印该值.
如果使用负值调用它,则不会打印任何内容.

If you call MyMethod with a positive or zero parameter, it will print the value.
If you call it with a negative value it will not print anything.


这篇关于我需要知道这段代码中关键字返回的功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-19 13:54
查看更多