C # condition judgment

xiaoxiao2021-03-06  109

DataSet DS = NULL;

IF (DS! = null && ds.tables! = null) // 1

{

String s = "1";

}

IF (ds == null && ds.tables! = null) // 2

{

String s = "1";

}

IF (DS! = null || ds.tables! = null) // 3

{

String s = "1";

}

IF (DS == Null || DS.TABLES! = NULL) // 4

{

String s = "1";

}

--------------------------------

In the four judges above, 1 and 4 will not throw it, 2, 3 will throw anomalies.

转载请注明原文地址:https://www.9cbs.com/read-99597.html

New Post(0)