在阅读了c#的隐藏特性之后,我想知道Java的隐藏特性有哪些?
当前回答
作为初学者,我非常欣赏Java 6中的JConsole监控软件,它已经为我解决了一些问题,而且我还在不断地寻找它的新用途。
显然JConsole在Java 5中已经有了,但我认为现在它已经改进了,至少现在工作得更稳定了。
Java 5中的JConsole: Java 5中的JConsole
Java 6中的JConsole: Java 6中的JConsole
当你在做它的时候,好好看看本系列中的其他工具: java6故障排除工具
其他回答
我今天才(重新)了解到$是Java中方法或变量的合法名称。与静态导入相结合,可以生成一些可读性稍强的代码,这取决于你对可读的看法:
http://garbagecollected.org/2008/04/06/dollarmaps/
The power you can have over the garbage collector and how it manages object collection is very powerful, especially for long-running and time-sensitive applications. It starts with weak, soft, and phantom references in the java.lang.ref package. Take a look at those, especially for building caches (there is a java.util.WeakHashMap already). Now dig a little deeper into the ReferenceQueue and you'll start having even more control. Finally grab the docs on the garbage collector itself and you'll be able to control how often it runs, sizes of different collection areas, and the types of algorithms used (for Java 5 see http://java.sun.com/docs/hotspot/gc5.0/gc_tuning_5.html).
JDK 1.6_07+包含一个名为VisualVM (bin/jvisualvm.exe)的应用程序,它是许多工具之上的一个漂亮的GUI。它似乎比JConsole更全面。
作为初学者,我非常欣赏Java 6中的JConsole监控软件,它已经为我解决了一些问题,而且我还在不断地寻找它的新用途。
显然JConsole在Java 5中已经有了,但我认为现在它已经改进了,至少现在工作得更稳定了。
Java 5中的JConsole: Java 5中的JConsole
Java 6中的JConsole: Java 6中的JConsole
当你在做它的时候,好好看看本系列中的其他工具: java6故障排除工具
我认为java的另一个“被忽视”的特性是JVM本身。它可能是可用的最好的VM。它支持许多有趣和有用的语言(Jython, JRuby, Scala, Groovy)。所有这些语言都可以轻松无缝地合作。
如果你设计了一种新的语言(就像在scala的例子中),你会立刻拥有所有现有的库,因此你的语言从一开始就是“有用的”。
所有这些语言都利用了HotSpot优化。VM可以很好地监控和调试。
推荐文章
- 在流中使用Java 8 foreach循环移动到下一项
- 访问限制:'Application'类型不是API(必需库rt.jar的限制)
- 用Java计算两个日期之间的天数
- 如何配置slf4j-simple
- 在Jar文件中运行类
- 带参数的可运行?
- 我如何得到一个字符串的前n个字符而不检查大小或出界?
- 我可以在Java中设置enum起始值吗?
- Java中的回调函数
- c#和Java中的泛型有什么不同?和模板在c++ ?
- 在Java中,流相对于循环的优势是什么?
- Jersey在未找到InjectionManagerFactory时停止工作
- 在Java流是peek真的只是调试?
- Recyclerview不调用onCreateViewHolder
- 将JSON字符串转换为HashMap