英文:
How to know if an `com.sun.jdi.ObjectReference` is an Enum?
问题
如何判断一个 com.sun.jdi.ObjectReference 实例是否为枚举?我可以通过 ObjectReference.type() 获取实例的类型,该方法会返回一个 ClassType(如果它是一个类)。
英文:
How to find out if an com.sun.jdi.ObjectReference instance is an enum? I can get the type of the instance with ObjectReference.type() which gives a ClassType back (if it is a class).
答案1
得分: 1
使用com.sun.jdi.ClassType上的isEnum()方法。
英文:
Use the isEnum() method on com.sun.jdi.ClassType
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。


评论