Java Auto-Unboxing Gotcha. Beware!

原文可能无法访问了,如果运气好的话,你还能看到我们对原文的 存档

摘要

What do you think that the following code snippet will print? Object o = true ? new Integer(1) : new Double(2.0); System.out.println(o); Yes! It will print: 1.0 What? 1.0? But I have assigned an In…

欢迎在评论区写下你对这篇文章的看法。

评论

首页 - Wiki
Copyright © 2011-2026 iteam. Current version is 2.154.0. UTC+08:00, 2026-02-25 04:31
浙ICP备14020137号-1 $访客地图$