Is there any difference between if(a==5) or if(5==a) in C#? -


बस मैं जानना चाहूंगा, इसमें कोई अंतर है

अगर (a = = 5) या यदि (5 == ए)

सी # में, कौन से बेहतर है?

कोई अंतर नहीं है - मान लें कि "a" एक पूर्णांक है।

I पता है कि कुछ लोगों को पसंद है (5 == ए) क्योंकि सी और amp; यदि आप लिखा है तो गलती से (5 = ए) आपको एक कंपाइलर त्रुटि मिलती है, जबकि अगर (a = 5) एक बग में परिणाम होगा।

C # बाद के मामले में एक कंपाइलर त्रुटि उठाता है, इसलिए यह कोई समस्या नहीं है।


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -