本文介绍了枚举与类加载器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有时您甚至可能不知道您插入代码的环境有多个类加载器。可能我还希望在这种情况下,操作==可以用于枚举值吗?

Sometimes you may even not know that the environment you plug you code in has more than one class loader. May I still expect that operation "==" will work on enum values in this case?

推荐答案

==将无法正常工作,但您也想使用 .equals()

"==" will not work, but you want to use .equals() anyway.

您可能对apache commons lang类感兴趣:

You might be interested in the apache commons lang class: link text

这篇关于枚举与类加载器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-12 07:57