Assigning null with explicit casting

Again, although it doesn't make sense to use explicit casting with null to assign it to a var type, it is a valid code, shown as follows:

var name = (String)null;             // Code compiles 

Though the preceding line of code is correct syntax-wise, it is a bad coding practice. Avoid it!

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.135.187.210