NullReferenceException C#中的异常

什么是NullReferenceException? (What is NullReferenceException?)

NullReferenceException is an exception and it throws when the code is trying to access a reference that is not referencing to any object. If a reference variable/object is not referencing to any object, then it will be considered as null. And, when the code tries to access this variable/object, there will be an exception known as NullReferenceException.

NullReferenceException是一个异常,当代码尝试访问未引用任何对象的引用时,将引发NullReferenceException 。 如果引用变量/对象未引用任何对象,则将其视为null 。 并且,当代码尝试访问此变量/对象时,将存在一个称为NullReferenceException的异常。

To handle NullReferenceException, we can write the code/message in catch block by using the NullRefere

你可能感兴趣的:(java,python,js,设计模式,spring,ViewUI)