- Java 11 and 12:New Features
- Mala Gupta
- 56字
- 2021-07-02 12:27:00
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!
推薦閱讀
- Java程序設計(慕課版)
- Java EE 6 企業級應用開發教程
- PHP 7底層設計與源碼實現
- 零基礎學Java(第4版)
- FFmpeg入門詳解:音視頻原理及應用
- 信息技術應用基礎
- HTML5+CSS3網頁設計
- Android Native Development Kit Cookbook
- 可解釋機器學習:模型、方法與實踐
- NetBeans IDE 8 Cookbook
- 基于SpringBoot實現:Java分布式中間件開發入門與實戰
- Learning YARN
- Oracle Data Guard 11gR2 Administration Beginner's Guide
- INSTANT JQuery Flot Visual Data Analysis
- AutoCAD基礎教程